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

Commit 8a101791 authored by Steven Cahail's avatar Steven Cahail Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: glink_ssr: Clear cb_data if channel open fails



When the G-Link SSR module creates channels for SSR notifications,
it assigns the callback data to the subsystem information structure
before the channel open is attempted. If the channel open fails, a
return occurs and the stale callback data will be kept. Also, the error
code -ENOMEM is incorrect.

Return the value of glink_open() in this failure case, and clear the
callback data if the channel open fails.

Change-Id: I3143b59ae655e2110492c0f58f851db765b5a74f
Signed-off-by: default avatarSteven Cahail <scahail@codeaurora.org>
parent c84f1f0f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -651,7 +651,8 @@ static int configure_and_open_channel(struct subsys_info *ss_info)
				 open_cfg.edge, open_cfg.name, __func__);
		kfree(cb_data);
		cb_data = NULL;
		return -ENOMEM;
		ss_info->cb_data = NULL;
		return PTR_ERR(handle);
	}
	ss_info->handle = handle;
	return 0;