Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8cebec46 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hwmon-for-linus-v4.9-rc5' of...

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
parents c1f4c2b2 38d8ed65
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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)) {