Skip to content

Commit bc84cff

Browse files
tititiou36chanwoochoi
authored andcommitted
extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'
In some error handling paths, a call to 'iio_channel_get()' is not balanced by a corresponding call to 'iio_channel_release()'. This can be achieved easily by using the devm_ variant of 'iio_channel_get()'. This has the extra benefit to simplify the remove function. Fixes: 1993986 ("extcon: adc_jack: adc-jack driver to support 3.5 pi or simliar devices") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
1 parent 1fa80f1 commit bc84cff

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/extcon/extcon-adc-jack.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int adc_jack_probe(struct platform_device *pdev)
124124
for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++);
125125
data->num_conditions = i;
126126

127-
data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel);
127+
data->chan = devm_iio_channel_get(&pdev->dev, pdata->consumer_channel);
128128
if (IS_ERR(data->chan))
129129
return PTR_ERR(data->chan);
130130

@@ -164,7 +164,6 @@ static int adc_jack_remove(struct platform_device *pdev)
164164

165165
free_irq(data->irq, data);
166166
cancel_work_sync(&data->handler.work);
167-
iio_channel_release(data->chan);
168167

169168
return 0;
170169
}

0 commit comments

Comments
 (0)