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

Commit a8fb633c authored by Arun Kumar Neelakantam's avatar Arun Kumar Neelakantam Committed by Chris Lew
Browse files

net: qrtr: Check function pointer before calling



sk_error_report callback function called without validating cause the NULL
pointer dereference.

Validate function pointer before using for error report.

Change-Id: I19d04f85a5457f3857623088f8e0578514f0c395
Signed-off-by: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
parent d2a50842
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -796,6 +796,7 @@ static void qrtr_reset_ports(void)

		sock_hold(&ipc->sk);
		ipc->sk.sk_err = ENETRESET;
		if (ipc->sk.sk_error_report)
			ipc->sk.sk_error_report(&ipc->sk);
		sock_put(&ipc->sk);
	}
@@ -893,6 +894,7 @@ static int qrtr_local_enqueue(struct qrtr_node *node, struct sk_buff *skb,
	if (sk && sk->sk_err == ENETRESET) {
		sock_hold(sk);
		sk->sk_err = ENETRESET;
		if (sk->sk_error_report)
			sk->sk_error_report(sk);
		sock_put(sk);
		kfree_skb(skb);