Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1c0b7e4 authored by Brendan Higgins's avatar Brendan Higgins Committed by Wolfram Sang
Browse files

i2c: aspeed: fixed potential null pointer dereference



Before I skipped null checks when the master is in the STOP state; this
fixes that.

Signed-off-by: default avatarBrendan Higgins <brendanhiggins@google.com>
Acked-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Fixes: f327c686 ("i2c: aspeed: added driver for Aspeed I2C")
parent 42543aeb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -410,9 +410,10 @@ static bool aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus)
	}

	/* We are in an invalid state; reset bus to a known state. */
	if (!bus->msgs && bus->master_state != ASPEED_I2C_MASTER_STOP) {
	if (!bus->msgs) {
		dev_err(bus->dev, "bus in unknown state");
		bus->cmd_err = -EIO;
		if (bus->master_state != ASPEED_I2C_MASTER_STOP)
			aspeed_i2c_do_stop(bus);
		goto out_no_complete;
	}