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

Commit ccc1dedd authored by Manohar Vavilapalli's avatar Manohar Vavilapalli
Browse files

devfreq: Add NULL check before using struct hwmon_node



Add NULL check to avoid potential NULL pointer dereference.

Change-Id: Iad0b29517f3114ee8ce45c8da22ef02e5a28cee0
Signed-off-by: default avatarManohar Vavilapalli <mvavilap@codeaurora.org>
parent 2f49ba7e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2020, 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
@@ -718,6 +718,8 @@ static int devfreq_bw_hwmon_get_freq(struct devfreq *df,
		*node->dev_ab = node->resume_ab;
		return 0;
	}
	if (!node)
		return -ENODEV;

	get_bw_and_set_irq(node, freq, node->dev_ab);