Skip to content

Commit 2bf5645

Browse files
committed
local: Use local_free_channel_pdata() to avoid duplicating code
Replace some code in set_channel_name() by a call to local_free_channel_pdata(), which does the exact same thing. Signed-off-by: Paul Cercueil <[email protected]>
1 parent 018e8e3 commit 2bf5645

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

local.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,8 +1491,7 @@ static int add_channel(struct iio_device *dev, const char *name,
14911491

14921492
ret = add_channel_to_device(dev, chn);
14931493
if (ret) {
1494-
free(chn->pdata->enable_fn);
1495-
free(chn->pdata);
1494+
local_free_channel_pdata(chn);
14961495
free_channel(chn);
14971496
}
14981497
return ret;

0 commit comments

Comments
 (0)