Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8110806rwi; Tue, 25 Oct 2022 02:36:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Pk1WK5CULEcqIh1BXXHZ0y9mH7zR6/chWoWHvl7udpC31XPWRrd8alzEEjfjfQORHGToa X-Received: by 2002:a17:907:75c8:b0:78d:b646:e768 with SMTP id jl8-20020a17090775c800b0078db646e768mr31275881ejc.432.1666690599757; Tue, 25 Oct 2022 02:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666690599; cv=none; d=google.com; s=arc-20160816; b=IGpjxHUi+HPIOYpAVHGI0ahLqh2a8Mc25MaBPz49SNme790nFf/pdh+2/z2OB4fT79 Ry7ZMUi4zbFGiwSHokuJZd2sxZnscDgjaHRgidjvvgc4yHmUbo5vOIwJa3aoUIHZH7yK MqIYRwZuxqkwKbFASt67LpvY6/3Sf76IHi9QyG8fYKw8X0INUlg7MsMGzAsOvcHnre1n gP8YZ9kx/DW8tukzTBjbyTeHdApxeOpyWfMJe84gxtIJ8s6YwieI1gFM/I4PTXjmWPHd Mckna2zibgGHgOdilN0z9wErLoiBLwXAQEiV71nH3LPPvgtSOxNKciEf5lTTWi6n/YKu ovyg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=NQGDjtnhvoIMjGlIIUPotnqzX5/+w+VwLHCabOPt+h8=; b=TEqml981AwEhxmzzJu7uo4WrNgQ1GVD21MctsnbTJ703qlV3x6Gf9LFO6cGnJ6sgZp r9K/pJd6t8c0/XnnubSKaS1TnyuMypooD5uDheiag+0jxM/UrW4qiCATB/Tvdgw1ZomR DAFbgQMDUjffjLleSn+cr3ylRYNU128oGEdg3T26StUxZ32w5mZl1xJAcXpHWQ+IemLb CEoNkrY4SqbgUAKFAGl17iXjowZNkeNiNQa67n/AC4MnrUg2qLhyfGIMqUQRcg+2JafW iW1k/ZuIKnN7tQ/LpGmyT9yrVnc1wHcS1lTm/ARRiP6EtgHJvIFZnRAPN/VK5hfk6yLR ybPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EzbDPXnX; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020aa7ca51000000b0046199bc9130si1842456edt.467.2022.10.25.02.36.13; Tue, 25 Oct 2022 02:36:39 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EzbDPXnX; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232042AbiJYJTZ (ORCPT + 99 others); Tue, 25 Oct 2022 05:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232404AbiJYJS7 (ORCPT ); Tue, 25 Oct 2022 05:18:59 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF2D016C20F for ; Tue, 25 Oct 2022 02:12:43 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id b2so10860051eja.6 for ; Tue, 25 Oct 2022 02:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NQGDjtnhvoIMjGlIIUPotnqzX5/+w+VwLHCabOPt+h8=; b=EzbDPXnXK+fRRH4bvsRuiyseGP+b7xX1aDuyWi8OlTpBv32jAiLDS0is9eE/zXawOK bIquBaSQdNVvot913dxq7RV6IQrvsKiWSVFoie10QkksEUvBRej1YClwTLd03VazDBrh 8IP/pa7qIrdCrUfKLT8D9EsB0DD0oTVO4eE3T/FOqnlUBy8Dmt2E5pmcInRd49AIZ9w7 9ZoHmVSBr+90etxEvyz9TjGryVNMGVjtNJU//Ev2JLShMXLf7iCE/4u90f+CjnjxXdwM 0qb1d33OkfPnyZpgOjvjXQNx1R/jouHoD0X5PS5N52AI3JnhicRHHC+mFopw/4aPOxvu yXGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NQGDjtnhvoIMjGlIIUPotnqzX5/+w+VwLHCabOPt+h8=; b=Lny2TbWHPLcGbYFV0OnjCksKZOTDm+qVces1lyy+jGEMtOFvz2+BPTRzLk6Ry5dGwL bK/2EKSzXfsJ3ZB2h6m0SS888Gv7KhBXSTQraN2a5v8/z3M/ijSN/XkyBFpu1ytvzqCn fs7dVxUMuX2/Yy6Nrzq+IwTyTrHsSy/SKD4NwUOW6NGnI60bkxyy5xb+o/t/aV/OaiKR b/veFLbv5n4ohzv/gewbaXAfYsmyZIzGTys47xwRwzo8KXElmLt6eGZ1a+5m36Ht8kSL 6Tke8kK0j1h0ChiJnvKiYKmtaib9BHQ3Q2pPcfPs3jAST06ewVZEwSWK+BHkjtz+hQxm yo2g== X-Gm-Message-State: ACrzQf3eSa7+5vx3RBwKx8eburgIL9NL0DMch6EumKSTs7df7Xfo6uGx gU9TN4em/bWoOsS/kKPgD0I= X-Received: by 2002:a17:907:a40d:b0:78d:9f66:e51f with SMTP id sg13-20020a170907a40d00b0078d9f66e51fmr32425502ejc.654.1666689162453; Tue, 25 Oct 2022 02:12:42 -0700 (PDT) Received: from localhost.localdomain (ip-217-105-46-178.ip.prioritytelecom.net. [217.105.46.178]) by smtp.gmail.com with ESMTPSA id bo12-20020a170906d04c00b00780f24b797dsm1061953ejb.108.2022.10.25.02.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 02:12:41 -0700 (PDT) From: Nam Cao To: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman Cc: namcaov@gmail.com, Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/4] staging: rtl8712: clean up dynamic memory management Date: Tue, 25 Oct 2022 11:12:22 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 This driver is fine if memory allocation never fails. However it does not handle allocation failure well. This can either lead to memory leak, or unallocated buffers being used. v2: Add a missing if statement, as noticed by Dan Carpenter Nam Cao (4): Revert "staging: r8712u: Tracking kmemleak false positives." staging: rtl8712: check for alloc fail in _r8712_init_recv_priv() staging: rtl8712: check for return value of _r8712_init_xmit_priv() staging: rtl8712: fix potential memory leak drivers/staging/rtl8712/os_intfs.c | 27 +++++++++++++++++++++----- drivers/staging/rtl8712/recv_osdep.h | 8 ++++---- drivers/staging/rtl8712/rtl8712_recv.c | 7 ++++--- drivers/staging/rtl8712/rtl871x_recv.c | 16 ++++++++------- 4 files changed, 39 insertions(+), 19 deletions(-) -- 2.25.1