Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4845265rwn; Sun, 11 Sep 2022 23:17:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR4zBbcCUgXzX1epQ5gUw62Ktg7v3e7Dcmgp4zb82WBgCUWQjV+0RqyU4l6djT77HOfPYUte X-Received: by 2002:a63:2a02:0:b0:42b:3b16:5759 with SMTP id q2-20020a632a02000000b0042b3b165759mr21877582pgq.564.1662963442350; Sun, 11 Sep 2022 23:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662963442; cv=none; d=google.com; s=arc-20160816; b=fEkcbOvx/jEw9lmpmevTbuoFeaRtryKB5bfWH0uh+m8Of9Tgaa1G9fzU2efjjf7eJC BogCBg/yDmIWqCL9e4yyhWIemFObsA4SrHMBWT2Im2+uClQvE0CfPHkIrKEx2/gg1BQ+ K7IuMxiw85pjBghbnnw1sB9tN06D32Eix2FMwusuq7PkAUhoLIy07Ehb1EF97PKoiIjt FSqxpZy9OJbPGbNft5khadcOUzKBwvcb3bpFr7Rac4zW8nrzDMHTJFZiiIggGHj4KsfJ Yu5Mbk/e4f4NVibmxYrquji1Hj2m5CQGnsxdFkYutLsIBcD0a2G7tWb5MOqZvWhIiJco MaCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=6dg+Lu1Bep7PnfC8XdEvo5IT5jfUK8MCbLJ7flDCQRM=; b=AlZnfltS9RDAqIIN4c3n0TfgzzMZBfNngoNctvrh9Iw80Ms0vyOZ0c1ott9JYSvDfj F8geFf7W5WjrT7hj9mF5I/AIzIjK3bLFxpqzOWncy+3pHWNwMQp39HP7wp3M2weZnWD8 z0jIBxnUjTXObzobpa2AKrkHsAOYcSFVQ1m6msH67oNmggWwm9WupCSgXAK2gM1JBZwO 6h5Fx2uB2iG7+XSy4lckOmQ/LMBTPEyOUO1kmvC8RGFX5doTqNZhl1rB8zbhL42ILXPu i69oFtMQ/4gSh8oijIqqTWcfy+MptJ22YmhwaS7k+ZJCjRUra7LHmBlUF/Yx/Nxv/lrc 16oA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh14-20020a17090b4ace00b00202516ce078si9767815pjb.4.2022.09.11.23.17.10; Sun, 11 Sep 2022 23:17:22 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229575AbiILF75 (ORCPT + 99 others); Mon, 12 Sep 2022 01:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiILF7y (ORCPT ); Mon, 12 Sep 2022 01:59:54 -0400 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF66013E04 for ; Sun, 11 Sep 2022 22:59:51 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=luoben@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VPOQ3u0_1662962379; Received: from localhost(mailfrom:luoben@linux.alibaba.com fp:SMTPD_---0VPOQ3u0_1662962379) by smtp.aliyun-inc.com; Mon, 12 Sep 2022 13:59:45 +0800 From: Ben Luo To: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: luoben@linux.alibaba.com Subject: [PATCH] mm/slub: return 0 when object pointer is NULL Date: Mon, 12 Sep 2022 13:59:39 +0800 Message-Id: <1662962379-16174-1-git-send-email-luoben@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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 NULL is definitly not a valid address Signed-off-by: Ben Luo --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index 862dbd9..50fad18 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -674,7 +674,7 @@ static inline int check_valid_pointer(struct kmem_cache *s, void *base; if (!object) - return 1; + return 0; base = slab_address(slab); object = kasan_reset_tag(object); -- 1.8.3.1