Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1021429pxb; Thu, 15 Apr 2021 11:54:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM3wDe82OdTwnm8fBcRYrqXetg3cMtSJTQZyZGpt2plY3UCpgsCjZF1QmrpLaLz4MDt2xl X-Received: by 2002:a17:90a:9281:: with SMTP id n1mr5414454pjo.146.1618512888942; Thu, 15 Apr 2021 11:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618512888; cv=none; d=google.com; s=arc-20160816; b=Qxklz9w9j8SMgPWnjs9LEinFDWwHPLGBF969Cyg2VjDUAfi8EK8KxEdyqfdrWG0SSq 5SHsfAbhLbKrlSDh0O1fP+afrKWgVATteuhVjP65ZmMPVPz+3kvAdIxzAcWiJKioVGZw Vx1w6nXt+CN1qoD+pCMBjc5wKJPvTGb+FWLc+Ym3UibNvXDvdxPa+hZ2pzoXbwJTkPgI vD7wu4EXho2Kg+/jJcBx3XoYntfkdFPAYIIlB1L5Hx8ub8cnxo2OBEik8X9A22xQck2p IijlLx0RbpVqoHIJND3zZNyHHZIbNQry9iayYeJBjT+yFq6RNfGX15C0HHe/pU5VI/Y8 +lxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=ioSDjCosYBMaoXZTFwokicPqHWchpTbihPd8kpDQNmE=; b=oXDDWoine9PxMa6UXUb6XJ0XJC9hS/BpK60p7bSvMfee3aTa+H/hOT65/XwL4kluWu gfKx6q2QHSPY6O3wyW1e3lT8yoBxVYAAy/4QjYHGrwYB0hN7/IlSMGnAjWIz/983iutf 7FlrwwRPoG/JFfYjJqXjYsebobaq/Gcbt3SICwL/WO9ailJbxbyxuLEE13dIvBDAK2oC emfmDgi5HpVPKKUZVSV315qdnZaAA2bFu2ltDMPbN1b2YLM0l6vO4ZI7oseNCFqDttum O9Fd9ws0zrAKFQopXy4DnyW68rc4FUFBxSKPx+4Vi0kq2nsVmWBsWO1+S+BhI+2VqPLV ZRFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si3953638pjr.107.2021.04.15.11.54.36; Thu, 15 Apr 2021 11:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234659AbhDOSxA (ORCPT + 99 others); Thu, 15 Apr 2021 14:53:00 -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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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; -- 2.27.0