]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix imm/ppa initializing bug in driver updates
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sat, 7 Feb 2004 12:47:32 +0000 (04:47 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 7 Feb 2004 12:47:32 +0000 (04:47 -0800)
Let's play spot the bug here...

Amazing that it survives in modular case...

drivers/scsi/imm.c
drivers/scsi/ppa.c

index 8b290ea429cf57b4ec662b26eea7c1b835c7e514..66825f08ef85d48f0e49edf213e6f59ef9af6f54 100644 (file)
@@ -1153,7 +1153,7 @@ static int __imm_attach(struct parport *pb)
        if (!dev)
                return -ENOMEM;
 
-       memset(dev, 0, sizeof(dev));
+       memset(dev, 0, sizeof(imm_struct));
 
        dev->base = -1;
        dev->mode = IMM_AUTODETECT;
index 69107395eaf8777bfad787f332375c13fea324eb..dfefed5126d4ab7f959077ca714663fb7161e404 100644 (file)
@@ -1010,7 +1010,7 @@ static int __ppa_attach(struct parport *pb)
        dev = kmalloc(sizeof(ppa_struct), GFP_KERNEL);
        if (!dev)
                return -ENOMEM;
-       memset(dev, 0, sizeof(dev));
+       memset(dev, 0, sizeof(ppa_struct));
        dev->base = -1;
        dev->mode = PPA_AUTODETECT;
        dev->recon_tmo = PPA_RECON_TMO;