From 13f81b30dcdaede4d7b3fc982a6d63c494aff666 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Sun, 19 Jul 2009 12:09:32 +0200 Subject: gspca - jpeg subdrivers: Check the result of kmalloc(jpeg header). From: Julia Lawall Priority: high Signed-off-by: Julia Lawall Signed-off-by: Jean-Francois Moine --- linux/drivers/media/video/gspca/sunplus.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers/media/video/gspca/sunplus.c') diff --git a/linux/drivers/media/video/gspca/sunplus.c b/linux/drivers/media/video/gspca/sunplus.c index f23594e0b..270b86f24 100644 --- a/linux/drivers/media/video/gspca/sunplus.c +++ b/linux/drivers/media/video/gspca/sunplus.c @@ -1008,6 +1008,8 @@ static int sd_start(struct gspca_dev *gspca_dev) /* create the JPEG header */ sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); + if (!sd->jpeg_hdr) + return -ENOMEM; jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 0x22); /* JPEG 411 */ jpeg_set_qual(sd->jpeg_hdr, sd->quality); -- cgit v1.2.3