re: usb: phy: phy-gpio-vbus-usb: use devm_ functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Himangi Saraogi,

The patch 9f7b23ce88e9: "usb: phy: phy-gpio-vbus-usb: use devm_
functions" from Jun 4, 2014, leads to the following static checker
warning:

	drivers/usb/phy/phy-gpio-vbus-usb.c:264 gpio_vbus_probe()
	warn: passing devm_ allocated variable to kfree. 'gpio_vbus'

drivers/usb/phy/phy-gpio-vbus-usb.c
   255  
   256          gpio_vbus = devm_kzalloc(&pdev->dev, sizeof(struct gpio_vbus_data),
   257                                   GFP_KERNEL);
   258          if (!gpio_vbus)
   259                  return -ENOMEM;
   260  
   261          gpio_vbus->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
   262                                            GFP_KERNEL);
   263          if (!gpio_vbus->phy.otg) {
   264                  kfree(gpio_vbus);
                              ^^^^^^^^^
Double free on error.

   265                  return -ENOMEM;
   266          }
   267  

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux