All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: jikos@kernel.org, jic23@kernel.org, benjamin.tissoires@redhat.com
Cc: jiapeng.chong@linux.alibaba.com, linux-input@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH 2/2] HID: hid-sensor-custom: Process failure of sensor_hub_set_feature()
Date: Thu, 15 Apr 2021 11:52:32 -0700	[thread overview]
Message-ID: <20210415185232.2617398-2-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <20210415185232.2617398-1-srinivas.pandruvada@linux.intel.com>

When user modifies a custom feature value and sensor_hub_set_feature()
fails, return error.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
Replaces patch: HID: hid-sensor-custom: remove useless variable
by Jiapeng Chong <jiapeng.chong@linux.alibaba.com> 

 drivers/hid/hid-sensor-custom.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
index 2628bc53ed80..58b54b127cdf 100644
--- a/drivers/hid/hid-sensor-custom.c
+++ b/drivers/hid/hid-sensor-custom.c
@@ -406,6 +406,8 @@ static ssize_t store_value(struct device *dev, struct device_attribute *attr,
 								report_id;
 		ret = sensor_hub_set_feature(sensor_inst->hsdev, report_id,
 					     index, sizeof(value), &value);
+		if (ret)
+			return ret;
 	} else
 		return -EINVAL;
 
-- 
2.27.0


  reply	other threads:[~2021-04-15 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 18:52 [PATCH 1/2] HID: hid-sensor-hub: Return error for hid_set_field() failure Srinivas Pandruvada
2021-04-15 18:52 ` Srinivas Pandruvada [this message]
2021-05-05 12:38   ` [PATCH 2/2] HID: hid-sensor-custom: Process failure of sensor_hub_set_feature() Jiri Kosina
2021-05-05 13:28     ` Benjamin Tissoires
2021-05-06  4:44       ` Pandruvada, Srinivas
2021-05-13 11:00         ` Jiri Kosina
2021-04-18 11:12 ` [PATCH 1/2] HID: hid-sensor-hub: Return error for hid_set_field() failure Jonathan Cameron
2021-04-18 11:15   ` Jonathan
2021-05-05 12:37 ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210415185232.2617398-2-srinivas.pandruvada@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=abaci@linux.alibaba.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.