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

Commit cfcb863a authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Gerrit - the friendly Code Review server
Browse files

power: smb1381: fix NULL pointer dereference



In standalone mode "parallel_psy" is not valid, add check
to validate parallel_psy before dereferencing.

Change-Id: I902ff2488a662c1994af88565f74d5dc7b8c3e4e
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent 30545cd5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1265,7 +1265,9 @@ static irqreturn_t smb138x_handle_temperature_change(int irq, void *data)
	struct smb_irq_data *irq_data = data;
	struct smb138x *chip = irq_data->parent_data;

	if (chip->parallel_psy)
		power_supply_changed(chip->parallel_psy);

	return IRQ_HANDLED;
}