Skip to content

Commit

Permalink
hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_k…
Browse files Browse the repository at this point in the history
…zalloc fail

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Axel Lin authored and Guenter Roeck committed May 12, 2013
1 parent f722406 commit 4510d19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/hwmon/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4510d19

Please sign in to comment.