Skip to content

Commit

Permalink
[PATCH] update two drivers for poison.h
Browse files Browse the repository at this point in the history
Update two drivers to use poison.h.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Randy Dunlap authored and Linus Torvalds committed Jun 28, 2006
1 parent c9cf552 commit b3c681e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion drivers/atm/firestream.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/pci.h>
#include <linux/poison.h>
#include <linux/errno.h>
#include <linux/atm.h>
#include <linux/atmdev.h>
Expand Down Expand Up @@ -754,7 +755,7 @@ static void process_txdone_queue (struct fs_dev *dev, struct queue *q)
fs_kfree_skb (skb);

fs_dprintk (FS_DEBUG_ALLOC, "Free trans-d: %p\n", td);
memset (td, 0x12, sizeof (struct FS_BPENTRY));
memset (td, ATM_POISON_FREE, sizeof(struct FS_BPENTRY));
kfree (td);
break;
default:
Expand Down
6 changes: 6 additions & 0 deletions include/linux/poison.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@
#define POOL_POISON_FREED 0xa7 /* !inuse */
#define POOL_POISON_ALLOCATED 0xa9 /* !initted */

/********** drivers/atm/ **********/
#define ATM_POISON_FREE 0x12

/********** sound/oss/ **********/
#define OSS_POISON_FREE 0xAB

#endif
5 changes: 3 additions & 2 deletions sound/oss/via82cxxx_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/pci.h>
#include <linux/poison.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
Expand Down Expand Up @@ -3522,7 +3523,7 @@ static int __devinit via_init_one (struct pci_dev *pdev, const struct pci_device

err_out_kfree:
#ifndef VIA_NDEBUG
memset (card, 0xAB, sizeof (*card)); /* poison memory */
memset (card, OSS_POISON_FREE, sizeof (*card)); /* poison memory */
#endif
kfree (card);

Expand Down Expand Up @@ -3559,7 +3560,7 @@ static void __devexit via_remove_one (struct pci_dev *pdev)
via_ac97_cleanup (card);

#ifndef VIA_NDEBUG
memset (card, 0xAB, sizeof (*card)); /* poison memory */
memset (card, OSS_POISON_FREE, sizeof (*card)); /* poison memory */
#endif
kfree (card);

Expand Down

0 comments on commit b3c681e

Please sign in to comment.