Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2818106pxb; Mon, 1 Nov 2021 02:25:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0TeEwbWRN1beUFHFxKlSAoaD1DfP7xqiqgvhwH7qkpn7LPuH/Joh8otpGawtXcENnxO18 X-Received: by 2002:a05:6402:51d0:: with SMTP id r16mr39351004edd.353.1635758751698; Mon, 01 Nov 2021 02:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635758751; cv=none; d=google.com; s=arc-20160816; b=gOamZB6pXfjbzWpxgqGfFpL4pbbPs1D/WDc67i3sP50lzhZKhaHG0gCwccIDN+zBT9 eIzPmWZ9E5ABG1oeIyyGPfaBNBtAfT19nAsg9uaqjkKScxWQuCs6XIH9tuFxuBaGNVt/ NJK5xm292J5Z8l88bwdLrptRL5g87tbKGqpvuC1BIttdkquOExJF3qYQjkIGwZ7PXOVR 5p1HTJzCCRjCnCO1nAc5SgdSKvYC6iwqoImqe+XWpYzRKj6kgP/fNPhmSE/C+Hgx5oVa Rj/oX0wSZf+Z43m0b6vtL+FCnrfoZKuT4Oa+0lkmG6RI3LnLUHIXZ7EwdGrvGebrcV8O DOKw== 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=/J3IsKvlJ3Td5ICXYjZv7nha3wFKKB9ylhjTfY6NWRE=; b=OH0XzjIwb/gsUWf+R1h808MgD+r+twIAL9GjF1gZvMibTXZe96mtGeck799rqWbGi9 eUcZX+uzPuycKxD93Z2nmqcywx9aNDou7aFuvZNOdReuMOht/7OboEUX9bvdHjatg1cV zmLwm5ML0YDCyBpOJUi9V5itCyKW7rSxtl7cFZrsVKcDL6xhfdmb52kOE3DIDDqRmoGj BVGC0WD0015mH3Ab3wXRSDTDvu4rp2TvWQ8dfCD9nuEhfkWUX6BjSInhhNSE6rAQF2hV rhnaUxuxaYcxC7aris5WcziouSjNe7bFfZYQQeuVdU3UJf39agoD8szhR9wytet+4VCn euiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jG+0ZJyY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si26377136edd.142.2021.11.01.02.25.28; Mon, 01 Nov 2021 02:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jG+0ZJyY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232951AbhKAJ0U (ORCPT + 99 others); Mon, 1 Nov 2021 05:26:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231901AbhKAJXk (ORCPT ); Mon, 1 Nov 2021 05:23:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6C0661101; Mon, 1 Nov 2021 09:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758455; bh=j16t0ctCD5BX5QKAYLGDPEG43aYiyhjPdluF9usODhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jG+0ZJyYDZ/DJ9PRZZJZk48ynZwytTnLvfhdBgQNSLQH75Cp6Tn0gUVUlLe9MF+OO 7DBXc7tIRWm3xn55YDXfrA1BRcu51pP1O9Tq3BpxAZrwasCT0TEcxH193SDF662bjd 5FK7Xofc8XE4ovBFoA0Bt+UEnvTSW9G+q7QU+JTo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , "David S. Miller" Subject: [PATCH 4.14 09/25] nfc: port100: fix using -ERRNO as command type mask Date: Mon, 1 Nov 2021 10:17:21 +0100 Message-Id: <20211101082449.226807061@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082447.070493993@linuxfoundation.org> References: <20211101082447.070493993@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski commit 2195f2062e4cc93870da8e71c318ef98a1c51cef upstream. During probing, the driver tries to get a list (mask) of supported command types in port100_get_command_type_mask() function. The value is u64 and 0 is treated as invalid mask (no commands supported). The function however returns also -ERRNO as u64 which will be interpret as valid command mask. Return 0 on every error case of port100_get_command_type_mask(), so the probing will stop. Cc: Fixes: 0347a6ab300a ("NFC: port100: Commands mechanism implementation") Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/nfc/port100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/nfc/port100.c +++ b/drivers/nfc/port100.c @@ -1012,11 +1012,11 @@ static u64 port100_get_command_type_mask skb = port100_alloc_skb(dev, 0); if (!skb) - return -ENOMEM; + return 0; resp = port100_send_cmd_sync(dev, PORT100_CMD_GET_COMMAND_TYPE, skb); if (IS_ERR(resp)) - return PTR_ERR(resp); + return 0; if (resp->len < 8) mask = 0;