mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 08:12:41 -04:00
Merge tag 'hwmon-for-linus-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fix from Guenter Roeck: "Fix resource leak on devm_kcalloc failure" * tag 'hwmon-for-linus-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (core) fix resource leak on devm_kcalloc failure
This commit is contained in:
@@ -536,8 +536,10 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
|
||||
|
||||
hwdev->groups = devm_kcalloc(dev, ngroups, sizeof(*groups),
|
||||
GFP_KERNEL);
|
||||
if (!hwdev->groups)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
if (!hwdev->groups) {
|
||||
err = -ENOMEM;
|
||||
goto free_hwmon;
|
||||
}
|
||||
|
||||
attrs = __hwmon_create_attrs(dev, drvdata, chip);
|
||||
if (IS_ERR(attrs)) {
|
||||
|
||||
Reference in New Issue
Block a user