Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3019159pxb; Mon, 18 Oct 2021 06:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycnrtc2kZaQ2ewZZqMqu9s1di2XENvVYqxqIbuw0ORUp7FsCTi5sf3L8zZLcK55oL7BEOA X-Received: by 2002:a17:90a:df02:: with SMTP id gp2mr14016161pjb.196.1634564619451; Mon, 18 Oct 2021 06:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634564619; cv=none; d=google.com; s=arc-20160816; b=GUDs0MEkibMr0IEJrg8Nt2sba3DllwGhQLV9KRSfB/fcokdzQjccuQT46LDVcfyOTG hQYI3rErYT38R0NG2bbXBgc8Drpnzwo5UDZa6d7CYRQxX6BNzLDBhmKwD3gDBaJDTGIh neKGC4V/hvfqHUEA2AKVPeE2N9RSMgl9bbGwoLLIHepyHu1PsE6qzebvkRSwfh1Oke0u +0qqGgUxP5T59rMGtXOqhkQ1YrHOVnZBym9ZPSXz4gp6xQIVOkVOs8YGaFAceXGODaye GrYohs10JBjtqNlwgR7QVySSpn9RZ+eGExCocWNN+lW7w+pgc9IApjTFKw8bdj1doJPh 9V9g== 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=ciopSObljGWGrnAwHoSzuMh+GbS64FpDpKCxyqRs75c=; b=arWKgsULigWf53y8jDqxNSTwqT68O/6eqICJoj2qfLdmVh/TPrTJ43GtjO9hjhoApz PP4FX3oHWKGDr9E/jzY1Hchw4KVVeYq2CBbA3bBcao01pEUJBZPeeJ82UfR8gjE0ocoV WS8chv/OGmvIMEvHrWkg38bFApZxOHT3uMTDww4xdxDoQFxY0NlgRZ4bZjCwFz52tKtL RBWF3xiDfT/3qM2U9ZiYk2sWPx6zdT5yeoZuZ9t5WuoLdEPEGxOqb6DTgPbLAftjwJa5 +vDdn1XscONgAOQsWxaJUApJTVxNwQNmwmSb597QziUV2ROPWRPFg7frGdEh8Y9Blzsn rgMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xp1AQsGn; 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 u5si29894974pjg.160.2021.10.18.06.43.24; Mon, 18 Oct 2021 06:43:39 -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=Xp1AQsGn; 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 S233495AbhJRNm5 (ORCPT + 99 others); Mon, 18 Oct 2021 09:42:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:35684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233600AbhJRNks (ORCPT ); Mon, 18 Oct 2021 09:40:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B9A861452; Mon, 18 Oct 2021 13:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564012; bh=V5q8jqpNLEFvULBQ/nLGImYDqTsVmi2RD6LJkW5bd4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xp1AQsGn8ATI+IZvQBU2XKF8UdUztiXp2GH8BpqcO1Xgh9tm8CP7T4fMtS8PCiYyL Qx9ZqeqE7BVcBGuvZL26Uis6HEf94Fiket+DJmxBdh5ra/XAaS7eUrG5Ai5NRPdw2b Yc2ELamCtRsOzGJW/k8wD77mrSWGKPTxmqQ1k+94= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 5.10 031/103] cb710: avoid NULL pointer subtraction Date: Mon, 18 Oct 2021 15:24:07 +0200 Message-Id: <20211018132335.770620578@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132334.702559133@linuxfoundation.org> References: <20211018132334.702559133@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: Arnd Bergmann commit 42641042c10c757fe10cc09088cf3f436cec5007 upstream. clang-14 complains about an unusual way of converting a pointer to an integer: drivers/misc/cb710/sgbuf2.c:50:15: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction] return ((ptr - NULL) & 3) != 0; Replace this with a normal cast to uintptr_t. Fixes: 5f5bac8272be ("mmc: Driver for CB710/720 memory card reader (MMC part)") Cc: stable Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210927121408.939246-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/misc/cb710/sgbuf2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/misc/cb710/sgbuf2.c +++ b/drivers/misc/cb710/sgbuf2.c @@ -47,7 +47,7 @@ static inline bool needs_unaligned_copy( #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS return false; #else - return ((ptr - NULL) & 3) != 0; + return ((uintptr_t)ptr & 3) != 0; #endif }