提交 ac563cfd 编写于 作者: M Matthew Wilcox 提交者: Greg Kroah-Hartman

USB: uas: Use kzalloc instead of kmalloc

The IUs are not being fully initialised by the driver (due to the reserved
space).  Since we should be zeroing reserved fields, use kzalloc to do
it for us.
Reported-by: NLuben Tuikov <ltuikov@yahoo.com>
Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 4400ef31
......@@ -297,7 +297,7 @@ static struct urb *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t gfp,
if (!urb)
goto out;
iu = kmalloc(sizeof(*iu), gfp);
iu = kzalloc(sizeof(*iu), gfp);
if (!iu)
goto free;
......@@ -328,7 +328,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
if (len < 0)
len = 0;
len = ALIGN(len, 4);
iu = kmalloc(sizeof(*iu) + len, gfp);
iu = kzalloc(sizeof(*iu) + len, gfp);
if (!iu)
goto free;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册