From patchwork Thu Aug 20 09:20:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 265313 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 90BBAC433DF for ; Thu, 20 Aug 2020 13:23:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E436208DB for ; Thu, 20 Aug 2020 13:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597929827; bh=ujjmrEC6yLqifjsXw+51ksnycUu8RYHEvep7NS0yCZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IVmv8KAHYA6pkb9PIWuDhzL6l9K4Bl6TJjKihn9lqWN+vbKbG8PA3PnqyXGvVcCm9 Py345nrLW7oL8GELT0VQlgV7WkOWy45oslN+BMGZ+kOmgf8B3fjhI02OCL6kVg43yi 3Ki8Vi2YV4yVVH37MvoBmgON2TaNSOr+sA+SJYKI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728571AbgHTNXo (ORCPT ); Thu, 20 Aug 2020 09:23:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:46734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728440AbgHTJeL (ORCPT ); Thu, 20 Aug 2020 05:34:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9D26922B3F; Thu, 20 Aug 2020 09:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916037; bh=ujjmrEC6yLqifjsXw+51ksnycUu8RYHEvep7NS0yCZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gwSmllaSurz63P91rKIUXa0DQzxtcNbHGxINOR29Nep8/AeNuIr0RwsQQ7HPqS4NR 9ZE1hmrX/6oceRJjZMgpdSKZCLvKVFVG97kCzaJhAIsn0O8YeLFaq0ggl5BwHWivkB dfPAyRecDz0LzJLGDLUxy14kiFBlP20GIYuH3tc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.8 192/232] Input: sentelic - fix error return when fsp_reg_write fails Date: Thu, 20 Aug 2020 11:20:43 +0200 Message-Id: <20200820091622.091569929@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Colin Ian King [ Upstream commit ea38f06e0291986eb93beb6d61fd413607a30ca4 ] Currently when the call to fsp_reg_write fails -EIO is not being returned because the count is being returned instead of the return value in retval. Fix this by returning the value in retval instead of count. Addresses-Coverity: ("Unused value") Fixes: fc69f4a6af49 ("Input: add new driver for Sentelic Finger Sensing Pad") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200603141218.131663-1-colin.king@canonical.com Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/mouse/sentelic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index e99d9bf1a267d..e78c4c7eda34d 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c @@ -441,7 +441,7 @@ static ssize_t fsp_attr_set_setreg(struct psmouse *psmouse, void *data, fsp_reg_write_enable(psmouse, false); - return count; + return retval; } PSMOUSE_DEFINE_WO_ATTR(setreg, S_IWUSR, NULL, fsp_attr_set_setreg);