Commit 6710fb86 authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab

V4L/DVB (5078): Pvrusb2: It's safe to kfree() a null pointer

Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent e5bd0260
...@@ -1189,8 +1189,8 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp) ...@@ -1189,8 +1189,8 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
vp->dev_video = kmalloc(sizeof(*vp->dev_video),GFP_KERNEL); vp->dev_video = kmalloc(sizeof(*vp->dev_video),GFP_KERNEL);
vp->dev_radio = kmalloc(sizeof(*vp->dev_radio),GFP_KERNEL); vp->dev_radio = kmalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
if (!(vp->dev_video && vp->dev_radio)) { if (!(vp->dev_video && vp->dev_radio)) {
if (vp->dev_video) kfree(vp->dev_video); kfree(vp->dev_video);
if (vp->dev_radio) kfree(vp->dev_radio); kfree(vp->dev_radio);
kfree(vp); kfree(vp);
return NULL; return NULL;
} }
......
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