From: Mike Isely Date: Sat, 20 Jan 2007 03:02:26 +0000 (-0300) Subject: V4L/DVB (5078): Pvrusb2: It's safe to kfree() a null pointer X-Git-Tag: v2.6.21-rc2~66^2~139 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6710fb868b289d21139bd68262388e0ea34601eb;p=linux-2.6 V4L/DVB (5078): Pvrusb2: It's safe to kfree() a null pointer Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 0ecad5b3c0..4c2e4defd7 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -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_radio = kmalloc(sizeof(*vp->dev_radio),GFP_KERNEL); if (!(vp->dev_video && vp->dev_radio)) { - if (vp->dev_video) kfree(vp->dev_video); - if (vp->dev_radio) kfree(vp->dev_radio); + kfree(vp->dev_video); + kfree(vp->dev_radio); kfree(vp); return NULL; }