]> err.no Git - linux-2.6/commitdiff
[PATCH] zd1201 kmalloc size fix
authorAlexey Dobriyan <adobriyan@gmail.com>
Mon, 22 Aug 2005 20:11:09 +0000 (13:11 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 23 Aug 2005 18:44:30 +0000 (11:44 -0700)
Noticed by Coverity checker.

(akpm: I stole this from Greg's tree and used the (IMO) tidier sizeof(*p)
construct).

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/usb/net/zd1201.c

index 29cd801eb958461592a5359cc7c06f0fd181138c..e32a80b39182b5dbbc06d15b2f96abf1897f9e7f 100644 (file)
@@ -346,8 +346,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs)
                        if (datalen<14)
                                goto resubmit;
                        if ((seq & IEEE802_11_SCTL_FRAG) == 0) {
-                               frag = kmalloc(sizeof(struct zd1201_frag*),
-                                   GFP_ATOMIC);
+                               frag = kmalloc(sizeof(*frag), GFP_ATOMIC);
                                if (!frag)
                                        goto resubmit;
                                skb = dev_alloc_skb(IEEE802_11_DATA_LEN +14+2);