drbd: drbd_send(): Return a "real" error code if we have no socket
authorAndreas Gruenbacher <agruen@linbit.com>
Thu, 9 Dec 2010 22:52:22 +0000 (23:52 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:44:29 +0000 (16:44 +0100)
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 <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_main.c

index 2dfbcfa1a7b2b57499159e149a1fc47117663208..52378ccda745547d31fdef6dce0f0d2372ba9078 100644 (file)
@@ -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 ... ? */