Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2816171pxb; Mon, 1 Nov 2021 02:22:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0Ga+cToniPquQ0hZwj7thCel84mMDEUT6+F9KNwc0aoXtMlC9BkMBDiiPoxIo6y6Ct3OI X-Received: by 2002:a05:6e02:1d84:: with SMTP id h4mr17556038ila.265.1635758571565; Mon, 01 Nov 2021 02:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635758571; cv=none; d=google.com; s=arc-20160816; b=oVvXFWzppu0A/vdu3lsQDTYPzokBTzaPLGOig4l3wUMeqHwwVwEZ82gxhbMzVcdEjF s6Az+n+mkSmldlMtEB5PhoW6eL9fvdGRpL+o1aLeshaG9/u4whO0LtIUBZeRPm/pPMbK aNM9XLLq9FKhhQJzouveGOw2ZRt8vwi+An+FyhlaawIVhWZJDhO9xq/BxcB9Lctm3KM9 +wzYxxdlCrvdfH2o7CN0CExoMUuWT8GjgWWSsLT6D9qow2GTvbP1W7on/8o00WYilYvR NG02zjPEKpGEzLhp0QZFfCF1QW84dNaieZA0T61wKP33ACoOvjtBB6QhPp3LPDtBqEHm N9Hw== 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=Dwsfe8PWtM19VPnRtUxz22jwo4+yKyC5MxCcKVz49Qk=; b=DcME+6NEqbDRkjDCC/sA8jFOpVCJfEy2Glu8GV6fvMFtDQb6eIZi+VLCBu9v4VynGi 5aSjJojqvSkKaKhdd144dcxkcOpkHSDWMPV70b7dKI71frnE1dV3m2kqzBwPi2bwaltN Rnq8yQ8HK+ORvnqvjDxiGRq0T6d2i2Cc8cbM75obsYhFuYZlXr3gAY10bZIRtBZi1lQA O7FmAkUFp/2i7L7OTgarGhsheMyoShqNHgYITvNR/q7KT/duy7dZVt7akFUjGOLcQF8n XgSUsQHfLYOrfnEHK3JaCad6iAkb4vy5J3lH82fxIuxURSX60AEjc0WqKS65TG6B61xr ZzIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cM0XEcX4; 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 r17si23307300iov.20.2021.11.01.02.22.40; Mon, 01 Nov 2021 02:22: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=cM0XEcX4; 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 S232415AbhKAJYX (ORCPT + 99 others); Mon, 1 Nov 2021 05:24:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:58554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232318AbhKAJWp (ORCPT ); Mon, 1 Nov 2021 05:22:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF3D461181; Mon, 1 Nov 2021 09:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758399; bh=t+5vw9w4e8TA8m/8OMY0IRxAvMCb5tYvM4LFmNpksX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cM0XEcX4CcIzP5TbSywipM5i25ARsx9unySoyC65mwMlv4L8eVLPi5zjTpkzY4p0B 05CkpNG6aVjvWTMIY2kTz/3pEz+FVnEXJ2FlL+r7/xkj7rGIDxoUdzY9BeyOMdmzPs NlAd4Wmp/ZFz4aTgDt9HFiX7ajM5eh+uaJEaNvpQ= 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.9 09/20] nfc: port100: fix using -ERRNO as command type mask Date: Mon, 1 Nov 2021 10:17:18 +0100 Message-Id: <20211101082446.173948420@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082444.133899096@linuxfoundation.org> References: <20211101082444.133899096@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 @@ -1011,11 +1011,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;