Skip to content

Commit 1b0b5ca

Browse files
Lukasz Gemborowskigregkh
authored andcommitted
i2c: mux: reg: wrong condition checked for of_address_to_resource return value
commit 22ebf00eb56fe77922de8138aa9af9996582c2b3 upstream. of_address_to_resource return 0 on successful call but devm_ioremap_resource is called only if it returns non-zero value Signed-off-by: Lukasz Gemborowski <lukasz.gemborowski@nokia.com> Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 470f47f commit 1b0b5ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/muxes/i2c-mux-reg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux,
150150
mux->data.idle_in_use = true;
151151

152152
/* map address from "reg" if exists */
153-
if (of_address_to_resource(np, 0, &res)) {
153+
if (of_address_to_resource(np, 0, &res) == 0) {
154154
mux->data.reg_size = resource_size(&res);
155155
mux->data.reg = devm_ioremap_resource(&pdev->dev, &res);
156156
if (IS_ERR(mux->data.reg))

0 commit comments

Comments
 (0)