summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@redhat.com>2009-09-18 20:33:27 -0300
committerDouglas Schilling Landgraf <dougsland@redhat.com>2009-09-18 20:33:27 -0300
commit4531ca9b59c2253c2e28cfeaa5119bf09166e029 (patch)
tree8c0baaf694bea0686a89a9a6324539274707eac8 /linux
parent1b3c6a946d980cf70b0679679e3b56d7ce563db4 (diff)
downloadmediapointer-dvb-s2-4531ca9b59c2253c2e28cfeaa5119bf09166e029.tar.gz
mediapointer-dvb-s2-4531ca9b59c2253c2e28cfeaa5119bf09166e029.tar.bz2
GSPCA: kmalloc failure ignored in sd_start()
From: Roel Kluin <roel.kluin@gmail.com> Prevent NULL dereference if kmalloc() fails. Priority: normal Signed-off-by: Roel Kluin <roel.kluin@gmail.com> CC: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/gspca/jeilinj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux/drivers/media/video/gspca/jeilinj.c b/linux/drivers/media/video/gspca/jeilinj.c
index dbfa3ed6e..a11c97ebe 100644
--- a/linux/drivers/media/video/gspca/jeilinj.c
+++ b/linux/drivers/media/video/gspca/jeilinj.c
@@ -312,6 +312,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
/* create the JPEG header */
dev->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
+ if (dev->jpeg_hdr == NULL)
+ return -ENOMEM;
jpeg_define(dev->jpeg_hdr, gspca_dev->height, gspca_dev->width,
0x21); /* JPEG 422 */
jpeg_set_qual(dev->jpeg_hdr, dev->quality);