net: qrtr: Invoke sk_error_report() after setting sk_err
authorBjorn Andersson <bjorn.andersson@linaro.org>
Wed, 11 Oct 2017 06:45:17 +0000 (23:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Oct 2017 22:28:38 +0000 (15:28 -0700)
Rather than manually waking up any context sleeping on the sock to
signal an error we should call sk_error_report(). This has the added
benefit that in-kernel consumers can override this notification with
its own callback.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/qrtr/qrtr.c

index c2f5c13550c052de0484582af9aabda3500cc030..7e4b49a8349e0b8dc4c554b91299d04088958ff4 100644 (file)
@@ -541,7 +541,7 @@ static void qrtr_reset_ports(void)
 
                sock_hold(&ipc->sk);
                ipc->sk.sk_err = ENETRESET;
-               wake_up_interruptible(sk_sleep(&ipc->sk));
+               ipc->sk.sk_error_report(&ipc->sk);
                sock_put(&ipc->sk);
        }
        mutex_unlock(&qrtr_port_lock);