From: Andreas Gruenbacher Date: Thu, 9 Dec 2010 22:52:22 +0000 (+0100) Subject: drbd: drbd_send(): Return a "real" error code if we have no socket X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0d42c8e5724e470873fa7491200c083600f5787;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drbd: drbd_send(): Return a "real" error code if we have no socket Q: Can this case even trigger? Is failing this way any better than one that causes a NULL pointer access? Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 2dfbcfa1a7b2..52378ccda745 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1703,7 +1703,7 @@ int drbd_send(struct drbd_tconn *tconn, struct socket *sock, int rv, sent = 0; if (!sock) - return -1000; + return -EBADR; /* THINK if (signal_pending) return ... ? */