Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4451959imw; Tue, 19 Jul 2022 06:55:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vAyZqOQ65/7GUDADcMQIUEfgaid0irp4EdPkTdXlmz/s0b0vIhXLtDWVHXYfz7F/YHRuL2 X-Received: by 2002:a05:6402:368e:b0:43a:c074:ac7b with SMTP id ej14-20020a056402368e00b0043ac074ac7bmr43854107edb.139.1658238942128; Tue, 19 Jul 2022 06:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238942; cv=none; d=google.com; s=arc-20160816; b=JFogLJF37v2ZI48x4TKKLzlq9COA92vfxRbS9CAsd/JPz+YsVnwY8/N2uloa2u7oN4 +wKO4RAl7UblPcvNGiLh4GT3qo0sHahYLGBNBTCwtjENodeja7veJk3+kR9I0IL77UdD AQ8RjiTc3TMUxOhPJEx5RhZvDMEmvRqpBPeHiUuX/rHWKF7kEql9/NJvd7+UzBF2KX1W BsUn7TZpE0kiJ8zFtVGFR1FbVmfSuRDqvHTj3M61gFf0FumdRNaZnavrHjVV9rv7pfXe y0hMcYFZ4MwNlvQLsayGtcd25MwVKNl576xTsuPEaYJoFTFFYQUJXNlIsc7aoNI9OzR3 aeYg== 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=t7QJq/xhQLyGvKzHf9e4gZcFATz2V+SfoWNRDTHZvQ5E5hMagX1iELUpIjnLQqsxng RsYjkGcxi383zHLDMjD/UUkTj4mA8c6eYCjqtlj1HZHOD9UB3GMKkMO8gQW+0EQzKLjR dJDF99bf+XmaJY+2MAVyjs4+Zh+xBGmTG8RrRYjMHZMF1omny3YhXkIAoJ0YmsSh92+f 1TXUNQ2Wjv/OEDjPWZ54SngffIs7I11F2NMh99fOiY5HQcwZ6JKSv2eicGrIdvj+Y4XS DDaANpvRrMgGfxawImeYlxk8mylSgweW2Gf5Edrgr+JPHMWs7ZKlbQnymWsOdkw2Tc0b qp9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vyV/66sn"; 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 oz37-20020a1709077da500b00726c07b617fsi20289153ejc.512.2022.07.19.06.55.17; Tue, 19 Jul 2022 06:55:42 -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="vyV/66sn"; 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 S242895AbiGSNIQ (ORCPT + 99 others); Tue, 19 Jul 2022 09:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243138AbiGSNHn (ORCPT ); Tue, 19 Jul 2022 09:07:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2704DFA0; Tue, 19 Jul 2022 05:27:37 -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 9EE316020F; Tue, 19 Jul 2022 12:27:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DC93C341C6; Tue, 19 Jul 2022 12:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233656; bh=2RIulnpy12qPfd61qCeePjC6mrMyrKz5F9JHzlryf7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vyV/66snmrrRMqXOWXeksyywKZQBrReRayBhQaOIyxKZmeTtAtuo5Z0r8RNkU5kE9 1p95piaIJRocDKtQ28VD/2lgxhYV4lY8hGsw6HtnLT1Rie5fIRXfIO6vPcjdM8SFR/ bmXhsnpikEclOqD+du3+9SEdGpfhf/FRODYKC7mo= 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.18 179/231] NFC: nxp-nci: dont print header length mismatch on i2c error Date: Tue, 19 Jul 2022 13:54:24 +0200 Message-Id: <20220719114729.260805577@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114714.247441733@linuxfoundation.org> References: <20220719114714.247441733@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);