]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
intel_th: Fix user-visible error codes
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 17 Mar 2020 06:22:14 +0000 (08:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 14:34:18 +0000 (16:34 +0200)
commit ce666be89a8a09c5924ff08fc32e119f974bdab6 upstream.

There are a few places in the driver that end up returning ENOTSUPP to
the user, replace those with EINVAL.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: ba82664c134ef ("intel_th: Add Memory Storage Unit driver")
Cc: stable@vger.kernel.org # v4.4+
Link: https://lore.kernel.org/r/20200317062215.15598-6-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/intel_th/msu.c

index 6ebf6a2edb3325bbee48bd0c6e4a29c83600514e..ca2717137ad22d0f6b9eb47dea5dc408d5024b22 100644 (file)
@@ -499,7 +499,7 @@ static int msc_configure(struct msc *msc)
        lockdep_assert_held(&msc->buf_mutex);
 
        if (msc->mode > MSC_MODE_MULTI)
-               return -ENOTSUPP;
+               return -EINVAL;
 
        if (msc->mode == MSC_MODE_MULTI)
                msc_buffer_clear_hw_header(msc);
@@ -950,7 +950,7 @@ static int msc_buffer_alloc(struct msc *msc, unsigned long *nr_pages,
        } else if (msc->mode == MSC_MODE_MULTI) {
                ret = msc_buffer_multi_alloc(msc, nr_pages, nr_wins);
        } else {
-               ret = -ENOTSUPP;
+               ret = -EINVAL;
        }
 
        if (!ret) {
@@ -1173,7 +1173,7 @@ static ssize_t intel_th_msc_read(struct file *file, char __user *buf,
                if (ret >= 0)
                        *ppos = iter->offset;
        } else {
-               ret = -ENOTSUPP;
+               ret = -EINVAL;
        }
 
 put_count: