mirror of https://gitee.com/openkylin/linux.git
V4L/DVB (12284): gspca - jpeg subdrivers: Check the result of kmalloc(jpeg header).
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
26e744b6b6
commit
3eb0237d44
|
@ -846,6 +846,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);
|
||||
|
|
|
@ -201,6 +201,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,
|
||||
0x21); /* JPEG 422 */
|
||||
jpeg_set_qual(sd->jpeg_hdr, sd->quality);
|
||||
|
|
|
@ -1737,6 +1737,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,
|
||||
0x21); /* JPEG 422 */
|
||||
jpeg_set_qual(sd->jpeg_hdr, sd->quality);
|
||||
|
|
|
@ -670,6 +670,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);
|
||||
|
|
|
@ -333,6 +333,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);
|
||||
|
|
|
@ -973,6 +973,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);
|
||||
|
|
|
@ -7243,6 +7243,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,
|
||||
0x21); /* JPEG 422 */
|
||||
jpeg_set_qual(sd->jpeg_hdr, sd->quality);
|
||||
|
|
Loading…
Reference in New Issue