Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4373734imw; Tue, 19 Jul 2022 05:34:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s824Q/QpnE9S/cifTFWW1OtiZ6DUgI0VfomcrQYwV+PWxoAcac9oR/C25PjG2lfGWEoBpJ X-Received: by 2002:a05:6402:28ca:b0:43b:5235:f325 with SMTP id ef10-20020a05640228ca00b0043b5235f325mr21059012edb.320.1658234073438; Tue, 19 Jul 2022 05:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658234073; cv=none; d=google.com; s=arc-20160816; b=NfJ3wC1U42D5OzmJfxGyMU36PmxRFEIKN7+15PXyOQAUoD+6QqASzNg1DAVCdcQFQl JrXwGl/3EsoRblwkerZHx23qAOBPWUuGW4kSJGq2IUfw++HaRUHvJ5YKGb8XiO1Xjr9A rEwfq+3vhnwB40vzy54HKt+xTKunOaHZKzBSaAPecDziWfpHaQYS8zUYqzGKz31SnaNm cy7hKcuvjPc45E+ZU73nWeJ9k6Sa+20lW4rq2GuBueltI0BTJWZZUBpe8q3PRtzxSzus 6OzzSLeVgL2Pso/Co3x6Aj6LFMDQXU/NWanh8kbCCA+kli0UkcR/n9A/KU2GJG+KdaoE mkzA== 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=id449P5dO3ZMjDYbAGY2dfGORO4jHAp9iVEoktZqwDc=; b=SjkgABQa3C1628chOplnl9bCwgRVPJH21Izq3DxNwuuwR2obFcwiAQ05Y+lgmi+y/t scbAFAoSr33iX3IJH0qHRNxovOKk4+l7kda7v/RMNcNeMZ1C/gQhCW8LKRoclIRyf25Z GztmyWdpPBrIZ6RnxWaJTDRqmCu1HqprK3jIAM53KqWV8IpzTUcIczZEXq1wTgyB+arj t6zhObaPmczleSZJLRL924Ji3EvMSZnSI6gWSgAMTKR3IAgxG+yMhz6FrbfyWGsitS9e Sj6lQLx5CRutcCpzandfQW7QLabwp1Up3c8Iu8e8suCHkXgJV/uAonAcotZpc0uNiv1W wsmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QBFbqEnb; 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 h24-20020a170906829800b0072640916985si16088789ejx.373.2022.07.19.05.34.06; Tue, 19 Jul 2022 05:34:33 -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=QBFbqEnb; 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 S240007AbiGSM0n (ORCPT + 99 others); Tue, 19 Jul 2022 08:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239750AbiGSMYQ (ORCPT ); Tue, 19 Jul 2022 08:24:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3411445F67; Tue, 19 Jul 2022 05:09:05 -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 ams.source.kernel.org (Postfix) with ESMTPS id BFA57B81B2D; Tue, 19 Jul 2022 12:08:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19C55C341C6; Tue, 19 Jul 2022 12:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232516; bh=2RIulnpy12qPfd61qCeePjC6mrMyrKz5F9JHzlryf7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QBFbqEnbGtFyoOsFIvQM9iUS8Zbd1yNRCzbjTrWGckMW4dZbcERXV3XjWWzVUvJEY yKlYJnn7eK9v73D55Cc0v9RU/7antg8m7Ykw08HqGNNyJgyQJGwzMREC4vf0M7+8ja uIwlTqKIxp0IOGcpTK9Glf6e1Kvo680UCm/IQ1eQ= 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 5.10 084/112] NFC: nxp-nci: dont print header length mismatch on i2c error Date: Tue, 19 Jul 2022 13:54:17 +0200 Message-Id: <20220719114634.750619240@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@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(-) --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -122,7 +122,9 @@ static int nxp_nci_i2c_fw_read(struct nx skb_put_data(*skb, &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); @@ -166,7 +168,9 @@ static int nxp_nci_i2c_nci_read(struct n 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);