From patchwork Thu Apr 15 18:52:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Pandruvada X-Patchwork-Id: 422008 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EB61C43460 for ; Thu, 15 Apr 2021 18:52:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE151611AB for ; Thu, 15 Apr 2021 18:52:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234603AbhDOSw7 (ORCPT ); Thu, 15 Apr 2021 14:52:59 -0400 Received: from mga04.intel.com ([192.55.52.120]:31157 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234130AbhDOSw6 (ORCPT ); Thu, 15 Apr 2021 14:52:58 -0400 IronPort-SDR: iCQog4TSMRZgcB/LMvbyZy8VkTsQayTTur8j5c2Ogt0EpUq2BMBTK4iPvznEQ0Tu5G5ROAZxnd XNJoU0PcuKqg== X-IronPort-AV: E=McAfee;i="6200,9189,9955"; a="192792352" X-IronPort-AV: E=Sophos;i="5.82,225,1613462400"; d="scan'208";a="192792352" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 11:52:34 -0700 IronPort-SDR: DFBCUJEtDxUksTKRKNaAlzx0BVuxqACJB5p62qimFIR67QXky9d9LfVyRQsFMzqUCKGbsjveTz 8urLasqI4jbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,225,1613462400"; d="scan'208";a="384108664" Received: from spandruv-desk.jf.intel.com ([10.54.75.21]) by orsmga006.jf.intel.com with ESMTP; 15 Apr 2021 11:52:33 -0700 From: Srinivas Pandruvada 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 , Abaci Robot Subject: [PATCH 2/2] HID: hid-sensor-custom: Process failure of sensor_hub_set_feature() Date: Thu, 15 Apr 2021 11:52:32 -0700 Message-Id: <20210415185232.2617398-2-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210415185232.2617398-1-srinivas.pandruvada@linux.intel.com> References: <20210415185232.2617398-1-srinivas.pandruvada@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org When user modifies a custom feature value and sensor_hub_set_feature() fails, return error. Reported-by: Abaci Robot Signed-off-by: Srinivas Pandruvada Reported-by: Abaci Robot Signed-off-by: Srinivas Pandruvada --- Replaces patch: HID: hid-sensor-custom: remove useless variable by Jiapeng Chong 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;