Received: by 10.192.165.148 with SMTP id m20csp2436513imm; Sun, 22 Apr 2018 07:05:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx48UFOFSh6sVljh2jCaRSMljg/sooStBeKi7pbsxSq0juQCaqTWPiFw1cejV8fyrtb2iOYbk X-Received: by 10.98.43.76 with SMTP id r73mr16676845pfr.65.1524405906656; Sun, 22 Apr 2018 07:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524405906; cv=none; d=google.com; s=arc-20160816; b=ePTj4sOBiOx1d0DUkmuy7Szfz7Tf3VhiJgw6KZbHODUev+vZG5Et4oV1zCIRcj/SQj ZFfZwdIMO6Y4figWUpsr0fCwyJZcDH2F53Zr/na2eB41G31rcy3hinR1S/PWp8NaUwr4 YwJK49HY5ljpjPg7wLS5Veozw27vK7wtRax0h14iRKQGRKXg4EztyaeFKxnOa9G9YzM1 Rb8APsT2IT9+Xe+xYjUr3pplBcG2ruxQIBGAV6iwEFPayZSqEBqsHEpLZh3odQk/V9yB JiJ5L61LlbfcVhwUHtQF4yvIrolDgIppkNLnd0ULJqM69tbqcaH6efMuFI5iwaZL5gb2 NINg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Amkv8cOyDhSaaIhEivNK9zXgQPUTkyn55YfIJpfEoNA=; b=W4R46mSV3sZZwlIKpKWNf2hLdllVh0WJQPbLgyZXnbYLHkZ5zABbaIbCS39FaaDnOw Pd3ye+jLIBtW6CbC84iUfbK1nibRNZbbVsF9XnkJofmKxJId/kXkf1lYOmDeN6eEKMyl PoFA9ZohGeOMqmvmfPRn1NvHaQmEUik9biruGQCtjhU9W/thRMiqeKvAvnlxaL1Ami7R ESVIqp08lkeEQNIrU1b+68KibmpkMaVl1GAnUreAIJtmkKq+pWlEjdsKjdMTUxkeYwGR rXjUz+hWkeKed2C6edLiW3aMUvbB8dDWJ4iqG+WJjodI7CRPuMTgzUe0cBb7/A4Lamfj qPpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g18-v6si9647868plo.586.2018.04.22.07.04.52; Sun, 22 Apr 2018 07:05:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755115AbeDVODh (ORCPT + 99 others); Sun, 22 Apr 2018 10:03:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49274 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755067AbeDVOD2 (ORCPT ); Sun, 22 Apr 2018 10:03:28 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 36D2DCBA; Sun, 22 Apr 2018 14:03:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Jiri Kosina , Aaron Ma Subject: [PATCH 4.16 195/196] HID: i2c-hid: fix inverted return value from i2c_hid_command() Date: Sun, 22 Apr 2018 15:53:35 +0200 Message-Id: <20180422135114.373083685@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiri Kosina commit b658912cb023cd6f8e46963d29779903d3c10538 upstream. i2c_hid_command() returns non-zero in error cases (the actual errno). Error handling in for I2C_HID_QUIRK_RESEND_REPORT_DESCR case in i2c_hid_resume() had the check inverted; fix that. Fixes: 3e83eda467 ("HID: i2c-hid: Fix resume issue on Raydium touchscreen device") Reported-by: Dan Carpenter Signed-off-by: Jiri Kosina Cc: Aaron Ma Signed-off-by: Greg Kroah-Hartman --- drivers/hid/i2c-hid/i2c-hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -1229,7 +1229,7 @@ static int i2c_hid_resume(struct device */ if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) { ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0); - if (!ret) + if (ret) return ret; }