Commit c4973923 authored by Sen Chu's avatar Sen Chu Committed by Greg Kroah-Hartman
parent 3ae3cf41
...@@ -384,6 +384,12 @@ static int pmif_spmi_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid, ...@@ -384,6 +384,12 @@ static int pmif_spmi_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
u32 data, wdata, cmd; u32 data, wdata, cmd;
unsigned long flags; unsigned long flags;
/* Check for argument validation. */
if (unlikely(sid & ~0xf)) {
dev_err(&ctrl->dev, "exceed the max slv id\n");
return -EINVAL;
}
if (len > 4) { if (len > 4) {
dev_err(&ctrl->dev, "pmif supports 1..4 bytes per trans, but:%zu requested", len); dev_err(&ctrl->dev, "pmif supports 1..4 bytes per trans, but:%zu requested", len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment