Skip to content

Commit

Permalink
i2c: mux: reg: failed memory allocation is logged elsewhere
Browse files Browse the repository at this point in the history
Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Reviewed-by: Alexander Sverdlin <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
  • Loading branch information
elfring authored and peda-r committed May 24, 2018
1 parent a2f8445 commit b30c08a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/i2c/muxes/i2c-mux-reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux,
values = devm_kzalloc(&pdev->dev,
sizeof(*mux->data.values) * mux->data.n_values,
GFP_KERNEL);
if (!values) {
dev_err(&pdev->dev, "Cannot allocate values array");
if (!values)
return -ENOMEM;
}

for_each_child_of_node(np, child) {
of_property_read_u32(child, "reg", values + i);
Expand Down

0 comments on commit b30c08a

Please sign in to comment.