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

Commit 68086030 authored by David Collins's avatar David Collins
Browse files

msm: platform: qpnp-clkdiv: fix potential null pointer dereference



Add a return statement in the spmi resource null check in
qpnp_clkdiv_probe().  This is needed in order to avoid
dereferencing a null pointer in a subsequent statement.

Change-Id: Iaf5d5797016c96a136e93c8e5837f7f8f31d1e47
CRs-Fixed: 563655
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 5dc679da
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2013, 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
@@ -202,6 +202,7 @@ static int qpnp_clkdiv_probe(struct spmi_device *spmi)
	if (!res) {
		dev_err(&spmi->dev, "%s: unable to get device reg resource\n",
					__func__);
		return -EINVAL;
	}

	q_clkdiv->slave = spmi->sid;