提交 caf5ca12 编写于 作者: L Lee Jones 提交者: Jonathan Cameron

iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data()

Gets rid of those unnecessary gotos.
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 efd9566f
......@@ -331,10 +331,8 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
unsigned int byte_for_channel = ch->scan_type.storagebits >> 3;
outdata = kmalloc(byte_for_channel, GFP_KERNEL);
if (!outdata) {
err = -EINVAL;
goto st_sensors_read_axis_data_error;
}
if (!outdata)
return -ENOMEM;
err = sdata->tf->read_multiple_byte(&sdata->tb, sdata->dev,
ch->address, byte_for_channel,
......@@ -349,7 +347,7 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
st_sensors_free_memory:
kfree(outdata);
st_sensors_read_axis_data_error:
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册