Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4368762imw; Tue, 19 Jul 2022 05:29:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkpximmKA/E5gMTBV9CrTXXzajbKIRv5dV6JawGtebp0Sx1Dl+tAXwqB6vFTkXXS0VnitG X-Received: by 2002:a05:6402:1c92:b0:43b:a336:2377 with SMTP id cy18-20020a0564021c9200b0043ba3362377mr1225884edb.15.1658233743651; Tue, 19 Jul 2022 05:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658233743; cv=none; d=google.com; s=arc-20160816; b=ECz6H+0BhaIisSZHI9aVoounv5RM3va/ppE3Rct0tIrkDJCGhQvvBEcdyBXv7n+q/p 0i0UO/zCIAQ0EgdtR3eT68ytb8a+W9+U4M4yrOI5W1TzISWb6L43C/NR2gVIv887LBV5 cC5dziTVboYty+YDHY/I2gW/PpkbL/KuZ2AWfb9ohyiuetTtrdFeOtSsFHOCGk4FVP2V ETj0q5hjZUbocQrU8RAwql+u0KukcqZeMC1W5ZHSaKqkpf+rY4sRciWx6vqDn12UCpqH ZRIK6IE4S3qOuU+QQJOMIlNLFyeSfLfy5JEYRkRQDRTQSrW2MpZ7z7jcFzr6PyJy5gIf KdJQ== 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=poPBJkbnHU6JmLPOtG0ZXQhzUSH8VA8xXwL6mNYd18Y=; b=FJdscbgTz7sakM0hwQqGZxj50Jod5TFbrQ5wfbY3vHjvw92iSeeR2LwuqtQ26WkyYg eYBXxRjSx5oVnr3WSDkJop8pckh845oG6jxIzTnGHQQJe0z9/XECPs+9+iDzB3K8kNGW lIWiNPYpr0WXT7PLbi7sE1NMfzdFeNrKW9gt20Z5b/9tnKWQ2ujwneli2IPeDdeWTRGX 6VMvdN7CKBIsDaIFOElRsQ0bP3O+cmxG9KTlik0h7+RSKyBWkfnVg6lqphCKOgav26XG rOPc6rXqMugg2c6AoBr16Eom9JmaG00gCwz41BXs0e7TuV3kye4AN3B7YOSx2ut+yHe5 5W8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XDn4BpPp; 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 mp9-20020a1709071b0900b0072f00759bfbsi16893270ejc.634.2022.07.19.05.28.38; Tue, 19 Jul 2022 05:29:03 -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=XDn4BpPp; 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 S238431AbiGSMH4 (ORCPT + 99 others); Tue, 19 Jul 2022 08:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238124AbiGSMHc (ORCPT ); Tue, 19 Jul 2022 08:07:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE8CD4F185; Tue, 19 Jul 2022 05:01:18 -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 6BD3F616D9; Tue, 19 Jul 2022 12:01:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B8A3C36AE3; Tue, 19 Jul 2022 12:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232072; bh=BYSkDoMCvQ3W7YygOuNe7+8nknrwvwOUQjK6Bbp4nJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XDn4BpPpDG+Q5LZzfPo6TkoM/lWlOrY+CPv8Blu8Z6nswy2Xv+yfPx+eh55Vy92dM P+5DRHpdVEm6xjcb2o5cBiUJKWl6WleUp9kapfUV9qgUYfqEjvmKwY+krj6cnq4Q6C cFM/izTbgHAM0nhT+5+zwVPMHgNmiUe9oCMi89mE= 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.19 33/48] NFC: nxp-nci: dont print header length mismatch on i2c error Date: Tue, 19 Jul 2022 13:54:10 +0200 Message-Id: <20220719114522.829212724@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114518.915546280@linuxfoundation.org> References: <20220719114518.915546280@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 @@ -138,7 +138,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); @@ -182,7 +184,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);