Commit 0cff5937 authored by Dan Carpenter's avatar Dan Carpenter Committed by 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: default avatarDan Carpenter <error27@gmail.com>
Acked-By: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ce02704d
...@@ -370,7 +370,11 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, ...@@ -370,7 +370,11 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
stddefs = kzalloc(sizeof(struct v4l2_standard) * std_cnt, stddefs = kzalloc(sizeof(struct v4l2_standard) * std_cnt,
GFP_KERNEL); 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; idx = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment