Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7551643rwi; Mon, 24 Oct 2022 16:38:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZSbxUux7I7VccE7EopifBxz/HVTxX7qADuSk2i2aqwUtRZ2exaOekwNjmq5KNx61tfyfc X-Received: by 2002:a63:1308:0:b0:440:5517:c99d with SMTP id i8-20020a631308000000b004405517c99dmr30141309pgl.550.1666654737614; Mon, 24 Oct 2022 16:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666654737; cv=none; d=google.com; s=arc-20160816; b=TMMHqlFGNLAqbS3gaUmmMCqs8bz83qfT8FL0+p/lTDKxSGk97cZM2h3GOBV/47Nu9T VezNAJxH6I6qFuDB+2iSJFS7Wi0cGM4S9wo7EJ4q8vbu5fC81x06FlUfYD5jUsFB1bti ZpBpxW3LesryUX9U03mdExTx3opPGRYggHRrpnmkAjz+NhsKMfvYAumK/k/1AOWSTDiZ U126KtdjTdOqCE0qZBH1E5+wlEsUnPYSUcLSaBeJbpb++WrMLaBT0PJxLECsbzR41phk W+2gKauxef3M0XIPPhGEbPV4Q0CaNqyyOvkGBzJYpyiJiUOqUSvwtUOn7ZIjubGWS69V BIIg== 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=bQAYa+fLJox/NZH1tjJ+liVfXSJpT0A7dg3CtjYLJqI=; b=aM100FPOB04kuPuM2KYtWl0f2L/vZqTqoUb9KpWWbe0Hq6gg9MWB9UksTHFdhrck05 yFeeM61RSs6kQ8Py+WY/rEtQY1vFv0o/Rt8QGww/b457sB1gj9sbxAuxLGwBXHXmffHV Y9g5msh5ly2VIjWeU22PzcQVtJ+eVso9WIbeyUBSRVRQ2ZR2ugSVM5WQl8Ww2+D7UKIs 72WUmNunmHX9Qw9d8yxnJ6x8PAEckFJH4ul6HZFEs4Wh9oiilZJZaf3iLt7mgpSfLFkB wlp7Nj5SPZQhnFddBXUwUEYaXjafJp8DrFMNPx556dVveBQJDyu1pCcKmYKXdRDZwQYV dTBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HhVMJjUW; 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 h69-20020a638348000000b0043ce4eee5f2si986954pge.433.2022.10.24.16.38.46; Mon, 24 Oct 2022 16:38:57 -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=HhVMJjUW; 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 S231199AbiJXXDf (ORCPT + 99 others); Mon, 24 Oct 2022 19:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230384AbiJXXDE (ORCPT ); Mon, 24 Oct 2022 19:03:04 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89E9A32BB0B for ; Mon, 24 Oct 2022 14:24:27 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id y69so14544630ede.5 for ; Mon, 24 Oct 2022 14:24:26 -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=bQAYa+fLJox/NZH1tjJ+liVfXSJpT0A7dg3CtjYLJqI=; b=HhVMJjUWnEX2/bI1fcYlS2gBN4LO5cARc0+K9EyA62L3szY9ESDnBfmlenWCHBxTIG 9vy5a96kBS86oMQaLFq2PEa81BKgxzaMg8HEKjzO7ZgvdtKLEnUV5RvLGBnvtZ6aEOuz ik8XLDXu2o9bv8KWayqeYf3zAWmDghmP1FdyX45mPd/35U0XTYMeTjbX7keIWzpMCjUX nNG/Sunew4FwvjZyw8Ql8JKMDOq7Fzs8DruAQ52t1GC/f5ekIjUqdBx3Ho/GlwKn5F1t W+l1441yRnA+T7AuovrqQD6zItmfx7sHzwzmdqWw22FLvB5UFyuaw7qQiGbMycTXLhcd 0ptw== 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=bQAYa+fLJox/NZH1tjJ+liVfXSJpT0A7dg3CtjYLJqI=; b=72tkDrwEO9QThdZQhWWcP3jOr6DXBnVjtxUYac2VmxSA/ss9ZfV8wEsb/7xJ7BXNx9 HLeFAVvNWPaLeKx6/Miw6LdWppcXAmGqm25zuUIUAHhbPZ3bl7kr1j3icZg3VZbpmyJ2 enOiMf2SFXSqt+gm9T7X2hERwVyVmZpudWCCOtWWtGIbZQ3beN34fc/deadw+wgyET/a 4IJz3cEZHKWqErTTjNoaMbxqFjqBRfY9JJgz5AJN7JAsGL25Zgq1+pJjGsxNXqzviMp9 uXdwyi/kOdb3yzenjV/TAVTULTWP0S8Us9oqGLi0jj9G8X29dnBB0pWemNZd+TD9L956 DlUg== X-Gm-Message-State: ACrzQf175xzLDT8fPEA+EQ3w4Qo6K11sCugyUsKbQaGD9hBwqJUyKQVv aVDPAUwFEOQAbZBsEU+gZEI= X-Received: by 2002:a05:6402:406:b0:458:a47:d14c with SMTP id q6-20020a056402040600b004580a47d14cmr32275444edv.41.1666646664353; Mon, 24 Oct 2022 14:24:24 -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 r1-20020a1709061ba100b007a9c3831409sm379354ejg.137.2022.10.24.14.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 14:24:23 -0700 (PDT) From: Nam Cao To: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman Cc: namcaov@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] staging: rtl8712: clean up dynamic memory management Date: Mon, 24 Oct 2022 23:24:05 +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. 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