re: power_supply: Change ownership from driver to core

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

 



Hello Krzysztof Kozlowski,

The patch 297d716f6260: "power_supply: Change ownership from driver
to core" from Mar 12, 2015, leads to the following static checker
warning:

	drivers/hid/hid-input.c:457 hidinput_setup_battery()
	error: potential NULL dereference 'dev->battery'.

drivers/hid/hid-input.c
   448          dev->battery = power_supply_register(&dev->dev, psy_desc, &psy_cfg);
   449          if (IS_ERR(dev->battery)) {
   450                  hid_warn(dev, "can't register power supply: %ld\n",
   451                                  PTR_ERR(dev->battery));
   452                  kfree(psy_desc->name);
   453                  kfree(psy_desc);
   454                  dev->battery = NULL;

Set to NULL.

   455          }
   456  
   457          power_supply_powers(dev->battery, &dev->dev);

Dereferenced inside function call.

   458  
   459  out:
   460          return true;
   461  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux