Revert "kdbus: connection: fix handling of failed fget()"
authorKonrad Lipinski <konrad.l@samsung.com>
Thu, 8 Sep 2016 14:47:38 +0000 (16:47 +0200)
committerKonrad Lipinski <konrad.l@samsung.com>
Fri, 9 Sep 2016 11:26:28 +0000 (13:26 +0200)
This reverts commit c021be145c56a87077165a05b9e26ea4b8403cb8.

ipc/kdbus/connection.c

index ab476fa9ccca40e56a240c2c4c41d80db05c9861..e554f1a71aa1c31bfa2b5cac0e16a63625d01340 100644 (file)
@@ -1997,8 +1997,9 @@ int kdbus_cmd_send(struct kdbus_conn *conn, struct file *f, void __user *argp)
 
        if (argv[1].item) {
                cancel_fd = fget(argv[1].item->fds[0]);
-               if (!cancel_fd) {
-                       ret = -EBADF;
+               if (IS_ERR(cancel_fd)) {
+                       ret = PTR_ERR(cancel_fd);
+                       cancel_fd = NULL;
                        goto exit;
                }