提交 81065e2f 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

[PATCH] zd1201 kmalloc size fix

Noticed by Coverity checker.

(akpm: I stole this from Greg's tree and used the (IMO) tidier sizeof(*p)
construct).
Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 005eca5e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册