提交 0cff5937 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

[media] pvrusb2: check for allocation failures

This function returns NULL on failure so lets do that if kzalloc()
fails.  There is a separate problem that the caller for this function
doesn't check for errors...
Signed-off-by: NDan Carpenter <error27@gmail.com>
Acked-By: NMike Isely <isely@pobox.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ce02704d
......@@ -370,7 +370,11 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
stddefs = kzalloc(sizeof(struct v4l2_standard) * std_cnt,
GFP_KERNEL);
for (idx = 0; idx < std_cnt; idx++) stddefs[idx].index = idx;
if (!stddefs)
return NULL;
for (idx = 0; idx < std_cnt; idx++)
stddefs[idx].index = idx;
idx = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册