Skip to contentSkip to conversation

hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail

PATCH In review Axel Lin 3 participants 4 messages Apr 23, 2013 – Apr 27, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail

---
 drivers/hwmon/iio_hwmon.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/iio_hwmon.c +4 -2
index aafa453..368497f 100644
@@ -84,8 +84,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
 		return PTR_ERR(channels);
 
 	st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
-	if (st = NULL)
-		return -ENOMEM;
+	if (st = NULL) {
+		ret = -ENOMEM;
+		goto error_release_channels;
+	}
 
 	st->channels = channels;
 
Signature · 9 lines
1.7.10.4




_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Axel Lin

Good catch.

Quoted 27 lines
---
 drivers/hwmon/iio_hwmon.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/iio_hwmon.c +4 -2
index aafa453..368497f 100644
@@ -84,8 +84,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
 		return PTR_ERR(channels);
 
 	st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
-	if (st == NULL)
-		return -ENOMEM;
+	if (st == NULL) {
+		ret = -ENOMEM;
+		goto error_release_channels;
+	}
 
 	st->channels = channels;
 
Signature · 1 line
1.7.10.4
#2 lore raw
Quoted 5 lines · Guenter Roeck
Quoted 1 line · Axel Lin

Good catch.

Given the timing this will need to go in through hwmon after the merge window is closed. Sorry, busy week or I would have caught up with this earlier.

Quoted 22 lines
Quoted 22 lines
---
 drivers/hwmon/iio_hwmon.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/iio_hwmon.c +4 -2
index aafa453..368497f 100644
@@ -84,8 +84,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
 		return PTR_ERR(channels);
 
 	st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
-	if (st = NULL)
-		return -ENOMEM;
+	if (st = NULL) {
+		ret = -ENOMEM;
+		goto error_release_channels;
+	}
 
 	st->channels = channels;
 
Quoted 10 lines
Quoted 6 lines
Signature · 1 line
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors