Hello Andrzej Pietrasiewicz,

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

The patch f3a3406b3f56: "usb: gadget: f_uac1: convert to new function
interface with backward compatibility" from Jul 22, 2014, leads to
the following Smatch complaint:

drivers/usb/gadget/function/u_uac1.c:216 gaudio_open_snd_dev()
         warn: variable dereferenced before check 'card' (see line 211)

drivers/usb/gadget/function/u_uac1.c
   210  
   211          opts = container_of(card->func.fi, struct f_uac1_opts, 
func_inst);
                                    ^^^^^^^^^^^^^
New dereference.

   212          fn_play = opts->fn_play;
                          ^^^^^^^^^^^^^
Technically, I think the container_of() just does pointer math and the
actual dereference is here.  I'm not sure, either way it's dereferenced.

   213          fn_cap = opts->fn_cap;
   214          fn_cntl = opts->fn_cntl;
   215  
   216          if (!card)
                    ^^^^^
Existing code assumes card can be NULL.

   217                  return -ENODEV;
   218  

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to