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

Commit 90df5bc0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "slimbus: slim-msm-ngd: Fix corner case to avoid NULL access"

parents 8e6e7836 ec24ad80
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@@ -425,6 +425,7 @@ static int ngd_xfer_msg(struct slim_controller *ctrl, struct slim_msg_txn *txn)
	const u8 *old_wbuf = NULL;
	bool report_sat = false;
	bool sync_wr = true;
	bool txn_async = txn->async;

	memset(wbuf, 0, sizeof(wbuf));
	if (txn->mc & SLIM_MSG_CLK_PAUSE_SEQ_FLG)
@@ -769,9 +770,9 @@ static int ngd_xfer_msg(struct slim_controller *ctrl, struct slim_msg_txn *txn)
		msm_slim_put_ctrl(dev);
	}
ngd_xfer_ret:
	if (txn->wbuf == wbuf)
	if (!txn_async && txn->wbuf == wbuf)
		txn->wbuf = old_wbuf;
	if (txn->comp == &done)
	if (!txn_async && txn->comp == &done)
		txn->comp = NULL;
	return ret ? ret : dev->err;
}