staging: gasket: gasket_handle_ioctl fix ioctl exit trace param
authorTodd Poynor <toddpoynor@google.com>
Sat, 21 Jul 2018 13:34:56 +0000 (06:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jul 2018 11:56:45 +0000 (13:56 +0200)
Pass the return value from the device ioctl permissions callback to the
tracepoint when the callback returns an error.

Reported-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gasket/gasket_ioctl.c

index dbe9fdef0c26882709dae0053ec9adb4eb978e43..1b164ac7a049605670067f1f0fcc9e10132726c4 100644 (file)
@@ -65,7 +65,7 @@ long gasket_handle_ioctl(struct file *filp, uint cmd, void __user *argp)
        if (ioctl_permissions_cb) {
                retval = ioctl_permissions_cb(filp, cmd, argp);
                if (retval < 0) {
-                       trace_gasket_ioctl_exit(-EPERM);
+                       trace_gasket_ioctl_exit(retval);
                        return retval;
                } else if (retval == 0) {
                        trace_gasket_ioctl_exit(-EPERM);