public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* re: [media] cx23885-dvb: use a better approach to hook set_frontend
@ 2013-09-02  9:20 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2013-09-02  9:20 UTC (permalink / raw)
  To: m.chehab; +Cc: linux-media

Hello Mauro Carvalho Chehab,

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

The patch 15472faf1259: "[media] cx23885-dvb: use a better approach
to hook set_frontend" from Aug 9, 2013, leads to the following Smatch
complaint:

drivers/media/pci/cx23885/cx23885-dvb.c:790 dvb_register()
	 error: we previously assumed 'fe0->dvb.frontend' could be null (see line 784)

drivers/media/pci/cx23885/cx23885-dvb.c
   783						       &i2c_bus->i2c_adap);
   784			if (fe0->dvb.frontend != NULL) {
                            ^^^^^^^^^^^^^^^^^^^^^^^^^
Existing check.

   785				dvb_attach(tda18271_attach, fe0->dvb.frontend,
   786					   0x60, &dev->i2c_bus[1].i2c_adap,
   787					   &hauppauge_hvr127x_config);
   788			}
   789			if (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1275)
   790				cx23885_set_frontend_hook(port, fe0->dvb.frontend);
                                                                ^^^^^^^^^^^^^^^^^
Patch adds dereference.

   791			break;
   792		case CX23885_BOARD_HAUPPAUGE_HVR1255:

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* re: [media] cx23885-dvb: use a better approach to hook set_frontend
@ 2013-11-01 10:25 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2013-11-01 10:25 UTC (permalink / raw)
  To: m.chehab; +Cc: linux-media

Hello Mauro Carvalho Chehab,

The patch 15472faf1259: "[media] cx23885-dvb: use a better approach
to hook set_frontend" from Aug 9, 2013, leads to the following
warning:
"drivers/media/pci/cx23885/cx23885-dvb.c:795 dvb_register()
	 error: we previously assumed 'fe0->dvb.frontend' could be null (see line 789)"

drivers/media/pci/cx23885/cx23885-dvb.c
   789                  if (fe0->dvb.frontend != NULL) {
                            ^^^^^^^^^^^^^^^^^^^^^^^^^
Null check.

   790                          dvb_attach(tda18271_attach, fe0->dvb.frontend,
   791                                     0x60, &dev->i2c_bus[1].i2c_adap,
   792                                     &hauppauge_hvr127x_config);
   793                  }
   794                  if (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1275)
   795                          cx23885_set_frontend_hook(port, fe0->dvb.frontend);
                                                                ^^^^^^^^^^^^^^^^^
New unchecked dereference.

   796                  break;

[snip]

  1138          case CX23885_BOARD_MYGICA_X8506:
  1139                  i2c_bus = &dev->i2c_bus[0];
  1140                  i2c_bus2 = &dev->i2c_bus[1];
  1141                  fe0->dvb.frontend = dvb_attach(lgs8gxx_attach,
  1142                          &mygica_x8506_lgs8gl5_config,
  1143                          &i2c_bus->i2c_adap);
  1144                  if (fe0->dvb.frontend != NULL) {
                            ^^^^^^^^^^^^^^^^^^^^^^^^^
check.

  1145                          dvb_attach(xc5000_attach,
  1146                                  fe0->dvb.frontend,
  1147                                  &i2c_bus2->i2c_adap,
  1148                                  &mygica_x8506_xc5000_config);
  1149                  }
  1150                  cx23885_set_frontend_hook(port, fe0->dvb.frontend);
                                                        ^^^^^^^^^^^^^^^^^
Dereference.
  1151                  break;


regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-01 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 10:25 [media] cx23885-dvb: use a better approach to hook set_frontend Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2013-09-02  9:20 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox