All of lore.kernel.org
 help / color / mirror / Atom feed
* [smatch stuff] mmv/VUB300: null dereferences in error handling
@ 2011-05-26 17:14 Dan Carpenter
  2011-05-27  3:16 ` [PATCH] mmc: vub300: fix " Chris Ball
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-05-26 17:14 UTC (permalink / raw)
  To: tony.olech; +Cc: linux-mmc


In vub300_probe() from drivers/mmc/host/vub300.c we dereference
vub300 when it's a NULL variable.  Btw, let's remove the bogus
initialization to NULL so that gcc will complain if the bug gets
introduced again.

  2119          if (!command_out_urb) {
  2120                  retval = -ENOMEM;
  2121                  dev_err(&vub300->udev->dev,
                                 ^^^^^^^^^^^^
  2122                          "not enough memory for the command_out_urb\n");
  2123                  goto error0;
  2124          }
  2125          command_res_urb = usb_alloc_urb(0, GFP_KERNEL);
  2126          if (!command_res_urb) {
  2127                  retval = -ENOMEM;
  2128                  dev_err(&vub300->udev->dev,
                                 ^^^^^^^^^^^^
  2129                          "not enough memory for the command_res_urb\n");
  2130                  goto error1;
  2131          }
  2132          /* this also allocates memory for our VUB300 mmc host device */
  2133          mmc = mmc_alloc_host(sizeof(struct vub300_mmc_host), &udev->dev);
  2134          if (!mmc) {
  2135                  retval = -ENOMEM;
  2136                  dev_err(&vub300->udev->dev,
                                 ^^^^^^^^^^^^
  2137                          "not enough memory for the mmc_host\n");
  2138                  goto error4;
  2139          }

regards,
dan carpenter

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

end of thread, other threads:[~2011-05-27  3:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-26 17:14 [smatch stuff] mmv/VUB300: null dereferences in error handling Dan Carpenter
2011-05-27  3:16 ` [PATCH] mmc: vub300: fix " Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.