From be9bac020cacd0cdf758b4a6d847a0ba835475b9 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 17 Aug 2017 14:53:55 +0300 Subject: i2c: mux: pinctrl: potential NULL dereference on error If i2c_mux_alloc() fails then we'd have a NULL dereference here. Fixes: c4aee3e1b0de ("i2c: mux: pinctrl: remove platform_data") Signed-off-by: Dan Carpenter Signed-off-by: Peter Rosin --- drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/i2c/muxes/i2c-mux-pinctrl.c') diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c index 20b90a7a1e61..cc6818aabab5 100644 --- a/drivers/i2c/muxes/i2c-mux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c @@ -173,7 +173,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev) err_del_adapter: i2c_mux_del_adapters(muxc); err_put_parent: - i2c_put_adapter(muxc->parent); + i2c_put_adapter(parent); return ret; } -- cgit v1.2.1