Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4368142imw; Tue, 19 Jul 2022 05:28:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tCqMcDo5kc1bmBci++mGVrF31SVeA8cIm3ldn0KMxQtObSOKqPxqnAy6K47Fg2B6kWSz0S X-Received: by 2002:a17:906:9754:b0:72f:38ff:efd7 with SMTP id o20-20020a170906975400b0072f38ffefd7mr7966963ejy.216.1658233689043; Tue, 19 Jul 2022 05:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658233689; cv=none; d=google.com; s=arc-20160816; b=RgJvy7dorbE/Wwk20OTVx20tWCK+klKRky/e+qAmbi48mbX5+F+Jwg28RhTTE7FyWA nj4gSg+kPDQxIXo5V9WBpaviW7HzDrWLh1fVggeKO5YkxvdysU+wmznva09ga3l7LX5+ X2Qvs57pky4RjVG3eWI8d0p6Brx0x5eOj/s2dhQOp3onrS17yWb1aq0ZpMmzD7P3r9BT //yeSK+A6CHPxufkMWFCJeHDhdi6Er/XtLRSjMGTHzlCujNCZzleIlCFvbd7fiz2z3dy s1HRYZwO3sGuQAr3gSZBhqvi/EcSspWG75RK0iRBrgVtVKgv1LpXBqhV9dGX3Do90s0R /d7g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UOOizHlnEZV1/dieeR30UYNKxeTj1P5kTOYJS8aCOvY=; b=nCcT0x4GfuJ1wEUQllfpcreRQ4bjQAwbuQw8HmazXJlEMsK5Yv6qBsu0fd+ZsvegFP OqbH04WJEVLMqxuMFSj0heDjCJtzjvUHolZZbOsV9GC5VHzBdcaU36rJ9CdbtsV1X0Z4 zPzFpcpvI6jiNB1sHYTfx/h7QUIfol5ddZPVS3BLaAQ/1LzxUUEM3awsk/nEc53zV7lt FTQE+4MWuepuXbeeG87L87m4gyDCR8vb8E/snQOQeXEQGVrsVLcH0BS4Cw5/KZFLgMNl eHXmUdC9nOewGwycUUz5hFOHsvzwILXVmpihWXlW6UyIKExEbu7YUjogQKuFwuaIRSQ8 OrgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qfGgOqtt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a056402270d00b0043a8c39f7c4si20322021edd.101.2022.07.19.05.27.43; Tue, 19 Jul 2022 05:28:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qfGgOqtt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237451AbiGSL41 (ORCPT + 99 others); Tue, 19 Jul 2022 07:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234301AbiGSL4L (ORCPT ); Tue, 19 Jul 2022 07:56:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 461BF41D25; Tue, 19 Jul 2022 04:56:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 76A04615AC; Tue, 19 Jul 2022 11:56:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 586B7C341C6; Tue, 19 Jul 2022 11:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658231762; bh=6qEqTDdxCBOBr/Uziw+QTc5odxpJHTiRQcib2au0pzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qfGgOqttCYQS9MfPINgf2RyPwh0YevYHsxe8MZnhCEAGk8jewELkAwaYHwmG7QFXA I//jf+aAyfnPd8gYFNZWavbwVazTslNHNNDsBsy2mwdf3QOdGUGcM81r6AFerB1leI wlHNlGc+g9UsymV9sM8LbT4UlhmkykEAlz62PY84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Krzysztof Kozlowski , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 18/28] NFC: nxp-nci: dont print header length mismatch on i2c error Date: Tue, 19 Jul 2022 13:53:56 +0200 Message-Id: <20220719114457.923484108@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114455.701304968@linuxfoundation.org> References: <20220719114455.701304968@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Walle [ Upstream commit 9577fc5fdc8b07b891709af6453545db405e24ad ] Don't print a misleading header length mismatch error if the i2c call returns an error. Instead just return the error code without any error message. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/nfc/nxp-nci/i2c.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c index a4f1a981e2dd..a9c8bfb62ebe 100644 --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -139,7 +139,9 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy, memcpy(skb_put(*skb, NXP_NCI_FW_HDR_LEN), &header, NXP_NCI_FW_HDR_LEN); r = i2c_master_recv(client, skb_put(*skb, frame_len), frame_len); - if (r != frame_len) { + if (r < 0) { + goto fw_read_exit_free_skb; + } else if (r != frame_len) { nfc_err(&client->dev, "Invalid frame length: %u (expected %zu)\n", r, frame_len); @@ -184,7 +186,9 @@ static int nxp_nci_i2c_nci_read(struct nxp_nci_i2c_phy *phy, return 0; r = i2c_master_recv(client, skb_put(*skb, header.plen), header.plen); - if (r != header.plen) { + if (r < 0) { + goto nci_read_exit_free_skb; + } else if (r != header.plen) { nfc_err(&client->dev, "Invalid frame payload length: %u (expected %u)\n", r, header.plen); -- 2.35.1