diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-18 19:33:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:53:30 -0400 |
commit | d8370f7eff14ef646ba4a81eb9642800518a7324 (patch) | |
tree | 6196ca523261e6e08821e8b0d3c630c10a52ee93 /drivers/media/video/gspca/jeilinj.c | |
parent | 8d04df4997b530d978d48a66655a99714af197ca (diff) |
V4L/DVB (13017): gspca: kmalloc failure ignored in sd_start()
Prevent NULL dereference if kmalloc() fails.
Cc: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/jeilinj.c')
-rw-r--r-- | drivers/media/video/gspca/jeilinj.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/jeilinj.c b/drivers/media/video/gspca/jeilinj.c index dbfa3ed6e8ef..a11c97ebeb0f 100644 --- a/drivers/media/video/gspca/jeilinj.c +++ b/drivers/media/video/gspca/jeilinj.c | |||
@@ -312,6 +312,8 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
312 | 312 | ||
313 | /* create the JPEG header */ | 313 | /* create the JPEG header */ |
314 | dev->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); | 314 | dev->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); |
315 | if (dev->jpeg_hdr == NULL) | ||
316 | return -ENOMEM; | ||
315 | jpeg_define(dev->jpeg_hdr, gspca_dev->height, gspca_dev->width, | 317 | jpeg_define(dev->jpeg_hdr, gspca_dev->height, gspca_dev->width, |
316 | 0x21); /* JPEG 422 */ | 318 | 0x21); /* JPEG 422 */ |
317 | jpeg_set_qual(dev->jpeg_hdr, dev->quality); | 319 | jpeg_set_qual(dev->jpeg_hdr, dev->quality); |