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

Commit a2b6d9b7 authored by Xiaozhe Shi's avatar Xiaozhe Shi
Browse files

power: qpnp-fg: fix null pointer dereference in suspend



Currently the driver uses the drvdata to get the chip data structure
during the pm ops for suspend. However, the drvdata is not set during
probe, so this ends up being a null pointer exception.

Fix this by setting the correct drvdata during probe.

CRs-Fixed: 709566
Change-Id: I978f3039c945d93cf43e6d53c5ace8a4d6105af5
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 3511ae2a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1871,6 +1871,7 @@ static int fg_probe(struct spmi_device *spmi)
	INIT_WORK(&chip->dump_sram, dump_sram);
	init_completion(&chip->sram_access);
	init_completion(&chip->batt_id_avail);
	dev_set_drvdata(&spmi->dev, chip);

	spmi_for_each_container_dev(spmi_resource, spmi) {
		if (!spmi_resource) {