From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7EC39A0582; Tue, 22 Nov 2022 16:52:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ACD8942D9F; Tue, 22 Nov 2022 16:52:46 +0100 (CET) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mails.dpdk.org (Postfix) with ESMTP id 1651042D77 for ; Tue, 22 Nov 2022 16:52:45 +0100 (CET) Received: by mail-lf1-f51.google.com with SMTP id c1so24176964lfi.7 for ; Tue, 22 Nov 2022 07:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Z1SjLkAO3WvhGQ5WOMMmC/8WFEim6XrqSE1A+x3TvvU=; b=fH1cKEjFigjlUXaFfkJVPE6VEh9hgOC3mJ1LkYc7RE7wWKQu8rYIh/z4R217LEGbjF v/52KMnqKslWcScHhs5elyvH6TMMt3XcX2XxlFrKLA/lWyxahMXaQZoiQHzhQl9bGSVE G5v2ojl2OVoO1XnZDUd8vPbAcn9rpLzXOEGsW7HAbSSpOLOQs6K0tSA67O5u4/S41UXV RjuU8DJzyKWI6FwsxHb29OqbcCvP3CXAeWe/ruJS1Q9reTZmET3zEGSLKvpMgS+ReCbg 1Pq5lAnRG9YYYEav0bYQu8F6BFa98T8LJdLQ9L4E2QxUnol9QErES9ZdJeVfnLmonIxQ mBJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z1SjLkAO3WvhGQ5WOMMmC/8WFEim6XrqSE1A+x3TvvU=; b=J0SaeTL4SGssUxd1RVewVIq9sxcN2JcMf6dGfHu7J5Pdulc/X9gQhIKhHSnIDhyOz9 FH9AR2M8D9o6iaOP8X3r0jLp9HWZh4EjeWBQMJfIbcsc8oqlDqkdgU2SHUrn0VomY3Si pslx0irwNUFSya2be083vcYd+4awr5cPPceUevwNMsdNlRCYPYTmOFxKUTjdetWrtmeA hSoE1lcazyyEpGN8Ux4On2b1x3YVH7Mxrz1LmKTdI2qSxbX5fvFiq0QXtAdXcblmKCap 4pWJ8eZQmnxxbihY/mkof4YYol6/cscR8niXiQiJomLqsn/aI3vmk/aAo3UrnWYjdA4A 39+Q== X-Gm-Message-State: ANoB5plWCY4FdQt7vNn67cKcoPqfitNNtAiOfYf6sTBV4rmfDwyGLfF/ gY2el6tBa5PSEbiWqWXgbz6j79wNmKY= X-Google-Smtp-Source: AA0mqf7i/ASy2PSbl68JW+qQBJz782ls9wb5uLYHqm38utJmDv0VRj0u62Vk640X8VAqAkyPFs9d/Q== X-Received: by 2002:ac2:4bd1:0:b0:4a2:4dc3:a2e with SMTP id o17-20020ac24bd1000000b004a24dc30a2emr4570014lfq.403.1669132364694; Tue, 22 Nov 2022 07:52:44 -0800 (PST) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id t4-20020a05651c204400b00277884e368esm1878571ljo.111.2022.11.22.07.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 07:52:44 -0800 (PST) Date: Tue, 22 Nov 2022 18:52:43 +0300 From: Dmitry Kozlyuk To: okaya@kernel.org Cc: dev@dpdk.org Subject: Re: [PATCH v2 09/11] malloc: check result of malloc_elem_free Message-ID: <20221122185243.7cdb3e59@sovereign> In-Reply-To: <20221121223208.1147154-10-okaya@kernel.org> References: <20221121223208.1147154-1-okaya@kernel.org> <20221121223208.1147154-10-okaya@kernel.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 2022-11-21 17:32 (UTC-0500), okaya@kernel.org: > From: Sinan Kaya > > In malloc_heap_free result of call to malloc_elem_free is dereferenced > here and may be null. It may not: "malloc_elem_free()" never returns NULL by definition: it takes a valid busy element and returns a valid free element. How about annotating the function instead?