i2c: mux: pinctrl: potential NULL dereference on error
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 17 Aug 2017 11:53:55 +0000 (14:53 +0300)
committerPeter Rosin <peda@axentia.se>
Thu, 17 Aug 2017 12:19:56 +0000 (14:19 +0200)
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 <dan.carpenter@oracle.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
drivers/i2c/muxes/i2c-mux-pinctrl.c

index 20b90a7a1e61f94197f70d4f515b425fc3955bcc..cc6818aabab515ba2b68badc030c2b6417cc6b94 100644 (file)
@@ -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;
 }