Skip to contentSkip to conversation

V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface

media Dan Carpenter 3 participants 5 messages Aug 23, 2013 – Apr 4, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

[ Going through some old warnings... ]

Hello Sylwester Nawrocki,

This is a semi-automatic email about new static checker warnings.

The patch babde1c243b2: "[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface" from Aug 22, 2012, leads to the following Smatch complaint:

drivers/media/platform/s3c-camif/camif-capture.c:463 queue_setup()
warn: variable dereferenced before check 'fmt' (see line 460)

drivers/media/platform/s3c-camif/camif-capture.c
455 if (pfmt) {

   456                  pix = &pfmt->fmt.pix;
   457                  fmt = s3c_camif_find_format(vp, &pix->pixelformat, -1);
   458                  size = (pix->width * pix->height * fmt->depth) / 8;
                                                           ^^^^^^^^^^

Dereference.

459 } else {

   460			size = (frame->f_width * frame->f_height * fmt->depth) / 8;
                                                                   ^^^^^^^^^^

Dereference.

461 }
462
463 if (fmt == NULL)

                    ^^^^^^^^^^^

Check.

   464			return -EINVAL;
   465		*num_planes = 1;

regards,
dan carpenter

#1 lore raw
Quoted 24 lines · Dan Carpenter

[ Going through some old warnings... ]

Hello Sylwester Nawrocki,

This is a semi-automatic email about new static checker warnings.

The patch babde1c243b2: "[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface" from Aug 22, 2012, leads to the following Smatch complaint:

drivers/media/platform/s3c-camif/camif-capture.c:463 queue_setup()
warn: variable dereferenced before check 'fmt' (see line 460)

drivers/media/platform/s3c-camif/camif-capture.c

    455          if (pfmt) {
    456                  pix =&pfmt->fmt.pix;
    457                  fmt = s3c_camif_find_format(vp,&pix->pixelformat, -1);
    458                  size = (pix->width * pix->height * fmt->depth) / 8;
                                                            ^^^^^^^^^^

Dereference.

    459		} else {
    460			size = (frame->f_width * frame->f_height * fmt->depth) / 8;
                                                                    ^^^^^^^^^^
Quoted 7 lines

Dereference.

    461		}
    462	
    463		if (fmt == NULL)
                     ^^^^^^^^^^^

Check.

Thanks for the bug report. This check of course should be before line 455. Would you like to sent a patch for this or should I handle that ?

--
Regards,
Sylwester

#2 lore raw
Quoted 27 lines · Sylwester Nawrocki
Quoted 26 lines · Dan Carpenter

[ Going through some old warnings... ]

Hello Sylwester Nawrocki,

This is a semi-automatic email about new static checker warnings.

The patch babde1c243b2: "[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface" from Aug 22, 2012, leads to the following Smatch complaint:

drivers/media/platform/s3c-camif/camif-capture.c:463 queue_setup()
warn: variable dereferenced before check 'fmt' (see line 460)

drivers/media/platform/s3c-camif/camif-capture.c

   455          if (pfmt) {
   456                  pix =&pfmt->fmt.pix;
   457                  fmt = s3c_camif_find_format(vp,&pix->pixelformat, -1);
   458                  size = (pix->width * pix->height * fmt->depth) / 8;
                                                           ^^^^^^^^^^

Dereference.

   459		} else {
   460			size = (frame->f_width * frame->f_height * fmt->depth) / 8;
                                                                   ^^^^^^^^^^

Dereference.

Quoted 8 lines
Quoted 5 lines
   461		}
   462	
   463		if (fmt == NULL)
                    ^^^^^^^^^^^

Check.

Thanks for the bug report. This check of course should be before line 455. Would you like to sent a patch for this or should I handle that ?

Could you handle it and give me the Reported-by tag?

regards,
dan carpenter

#3 lore raw
Quoted 34 lines · Dan Carpenter
Quoted 33 lines · Sylwester Nawrocki
Quoted 31 lines · Dan Carpenter

[ Going through some old warnings... ]

Hello Sylwester Nawrocki,

This is a semi-automatic email about new static checker warnings.

The patch babde1c243b2: "[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface" from Aug 22, 2012, leads to the following Smatch complaint:

drivers/media/platform/s3c-camif/camif-capture.c:463 queue_setup()
warn: variable dereferenced before check 'fmt' (see line 460)

drivers/media/platform/s3c-camif/camif-capture.c

   455          if (pfmt) {
   456                  pix =&pfmt->fmt.pix;
   457                  fmt = s3c_camif_find_format(vp,&pix->pixelformat, -1);
   458                  size = (pix->width * pix->height * fmt->depth) / 8;
                                                           ^^^^^^^^^^

Dereference.

   459		} else {
   460			size = (frame->f_width * frame->f_height * fmt->depth) / 8;
                                                                   ^^^^^^^^^^

Dereference.

   461		}
   462	
   463		if (fmt == NULL)
                    ^^^^^^^^^^^

Check.

Quoted 4 lines
Quoted 2 lines

Thanks for the bug report. This check of course should be before line 455. Would you like to sent a patch for this or should I handle that ?

Could you handle it and give me the Reported-by tag?

Sure, will do.

--
Regards,
Sylwester

#4 lore raw

Whatever happened with this btw? Also are you sure we don't need a second check after line 457?

regards,
dan carpenter

Quoted 45 lines · Sylwester Nawrocki
Quoted 34 lines · Dan Carpenter
Quoted 33 lines · Sylwester Nawrocki
Quoted 31 lines · Dan Carpenter

[ Going through some old warnings... ]

Hello Sylwester Nawrocki,

This is a semi-automatic email about new static checker warnings.

The patch babde1c243b2: "[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface" from Aug 22, 2012, leads to the following Smatch complaint:

drivers/media/platform/s3c-camif/camif-capture.c:463 queue_setup()
warn: variable dereferenced before check 'fmt' (see line 460)

drivers/media/platform/s3c-camif/camif-capture.c

   455          if (pfmt) {
   456                  pix =&pfmt->fmt.pix;
   457                  fmt = s3c_camif_find_format(vp,&pix->pixelformat, -1);
   458                  size = (pix->width * pix->height * fmt->depth) / 8;
                                                           ^^^^^^^^^^

Dereference.

   459		} else {
   460			size = (frame->f_width * frame->f_height * fmt->depth) / 8;
                                                                   ^^^^^^^^^^

Dereference.

   461		}
   462	
   463		if (fmt == NULL)
                    ^^^^^^^^^^^

Check.

Quoted 4 lines
Quoted 2 lines

Thanks for the bug report. This check of course should be before line 455. Would you like to sent a patch for this or should I handle that ?

Could you handle it and give me the Reported-by tag?

Sure, will do.

--
Regards,
Sylwester