From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74BFFC54EE9 for ; Sun, 4 Sep 2022 10:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbiIDKTM (ORCPT ); Sun, 4 Sep 2022 06:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233848AbiIDKTK (ORCPT ); Sun, 4 Sep 2022 06:19:10 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4795459A2; Sun, 4 Sep 2022 03:19:09 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id k6-20020a05600c1c8600b003a54ecc62f6so4156809wms.5; Sun, 04 Sep 2022 03:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date; bh=5G8LFHpgoS2bGPzH+k4SrdhCNJTqa4gUr30jZ6kq88I=; b=SpZIQA7padgNfPoNWhcBHbBCP41v/l/k79aeEchtFW7BkVHqo94TvJBkNdIgTfh5pb /KXC4xH8Fned6H+x+5Zz8/ZbpMldn9IopnWW4XF3fIUNbSHo1J2fnckh8rpy0CFa0fKR Mtop+dfMs2oM8MrjXakYLtfPUGQaNWkoItNXOKQtYUEjw6CmVv/W0Fk3DekeAgkrftbv qtDSr2r2C8JoshnLDV/VHYQL+94H5d8jBR9Qyadg1iTtBNOBBUqp5HXhGls8GcUTzK8S RwAOyBovjKqNaBM/3Vzi/hEr4tvdpjkybxRb4JXmXp0LwmCMVc9y1hGCEr19tVVu1jz2 VU4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=5G8LFHpgoS2bGPzH+k4SrdhCNJTqa4gUr30jZ6kq88I=; b=pfwdAKxMKy+aLcIWWIoV902nzPZnRMdZm3NpAsO5nAi+ya72JHcw2h/HO9tJCTvYXr 7qbzY3meWV+D6NBlY4iEvsqzN3VVknoXQ/igrdxcS+6ayAKrljoW8tzRipTs+V5tHEd+ v7arxbmTiR0Xt+YvI2Zi6hVY5bsclLK7J2Fzj10JDe5vFgdfWvpmNrwKnyTfcTf8qIPh nLgAUfO/PGA8OFNQPbR03Fgd9TqRB0g8J5EXX2gELtZcITy+VtazKxKsol2wbGAAQ3S0 Cp1xyxeXuWebLd6uRrjRm6MHZExcj8z3fK0lgLMF5OuLVCMxvW3BFcprVYlo4ch6TySu yZIA== X-Gm-Message-State: ACgBeo3mS7zB/4DY+kNr6rQs5/eKnuPmv8IuupC6apYesbWc0FKnvEdM 4kqhxzw7eIqFoOD3r1L90Q== X-Google-Smtp-Source: AA6agR5FwXGLMeTmdx/H1gFIW6Ga6Y7U4wblO9rTBVAk7+teH6Zw5/GJWd9ba4vwsyZSSMrgdXc5cw== X-Received: by 2002:a1c:7414:0:b0:3a5:fd9e:e629 with SMTP id p20-20020a1c7414000000b003a5fd9ee629mr8077705wmc.194.1662286748211; Sun, 04 Sep 2022 03:19:08 -0700 (PDT) Received: from playground (host-92-29-143-165.as13285.net. [92.29.143.165]) by smtp.gmail.com with ESMTPSA id j4-20020adfe504000000b00226cf855861sm5727153wrm.84.2022.09.04.03.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 03:19:07 -0700 (PDT) Date: Sun, 4 Sep 2022 11:18:59 +0100 From: Jules Irenge To: ast@kernel.org Cc: memxor@gmail.com, john.fastabend@gmail.com, andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, bpf@vger.kernel.org, inux-kernel@vger.kernel.org, Elana.Copperman@mobileye.com, jbi.octave@gmail.com Subject: [PATCH bpf-next] Fixes: 14a324f6a67e ("bpf: Wire up freeing of referenced kptr") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org This patch fixes a warning generated by Sparse "warning: Using plain integer as NULL pointer" by replacing p with *p in the WRITE_ONCE() macro This enables the pointer to be cleared on map value delete, hence clearing the warning. Signed-off-by: Jules Irenge --- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 27760627370d..f798acd43a28 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -598,7 +598,7 @@ void bpf_map_free_kptrs(struct bpf_map *map, void *map_value) if (off_desc->type == BPF_KPTR_UNREF) { u64 *p = (u64 *)btf_id_ptr; - WRITE_ONCE(p, 0); + WRITE_ONCE(*p, 0); continue; } old_ptr = xchg(btf_id_ptr, 0); -- 2.35.1