Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1998835ybl; Thu, 15 Aug 2019 04:58:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIx6Ga6k5kCUzKy9x/8XWbNu3mOM7g9jdzIh4V+OZ0PGiYivjkL4LpceMV9L1Fhx41KyuK X-Received: by 2002:a17:90a:f484:: with SMTP id bx4mr1880306pjb.61.1565870308463; Thu, 15 Aug 2019 04:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565870308; cv=none; d=google.com; s=arc-20160816; b=NOVdIQgdK6cTOzutaSYBpvC+1RgdIeaQQdg78qHkm6aEzTVHyJJVEIAeaqDTvRZ4f8 NsJ3if+t/GOD4EIn5djh+O5ZTiAEmJr6zrYHMnybz9A/oiQDFsDzrsjhOMN6p4ADf3zI 6Vzq+zTdu1+QqhpCwgtl1O14CiSJjAJ7HqOy+TYMBos6WkDxFWvKB53fwsOqNr4Ng16C hC3ve7c2qfEKuGHQ0OQ7cwcfPWdyOkj1MTtS+JeTVs/zoeUL8GcBOhlTKB3FmX/rEDZf MmKcCH8kCRKGe6uLG0bQ3gINf93sxX6C13KVzecYNYuqdDDPV7jvakPaxfZ8qVrU/Yrq 88bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=FSeSpWiddxEbXQrzi3ssj/cDKeDEqEGXeGyteEtffw0=; b=HexgG9F+uujIg8yfxoP363PzE/GBRSfdS6pOeqaGiHWnMUwJOBq5jrQI547pbtQUHI brmiSv/QHWHpMbwGCJlI0Ol5J/KVovC5E7HAbFQb/kbMTG+gSSolexzLdZu3VwAxydbJ 3YIy32Ol3WqKbMEYLac+GSRhM/cP5LwQPlrHU/IzRU/4yqXbmNf9p3nIHzG7X14ybKIN GsV9KlkxcFRo1MpLX6/6ZZ6luDqtwjmytIYMBwEEXQ0g+yzKy4WIsFMtT1WvypJSYJK6 qFyZ5Uq6yitT3BZOJvgLBJy5DvFd1LIJDG5SCcKoV5A6niToZAssAyd/qLfepFqHiLC8 3WOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si1911117pfi.205.2019.08.15.04.58.13; Thu, 15 Aug 2019 04:58:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731018AbfHOKmG (ORCPT + 99 others); Thu, 15 Aug 2019 06:42:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:51988 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726027AbfHOKmG (ORCPT ); Thu, 15 Aug 2019 06:42:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1EE1DADCB; Thu, 15 Aug 2019 10:42:03 +0000 (UTC) Message-ID: <1565865720.5780.3.camel@suse.com> Subject: Re: [PATCH] net: usbnet: fix a memory leak bug From: Oliver Neukum To: Wenwen Wang Cc: "David S. Miller" , open list , "open list:USB NETWORKING DRIVERS" , "open list:USB USBNET DRIVER FRAMEWORK" Date: Thu, 15 Aug 2019 12:42:00 +0200 In-Reply-To: <1565804493-7758-1-git-send-email-wenwen@cs.uga.edu> References: <1565804493-7758-1-git-send-email-wenwen@cs.uga.edu> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 14.08.2019, 12:41 -0500 schrieb Wenwen Wang: > In usbnet_start_xmit(), 'urb->sg' is allocated through kmalloc_array() by > invoking build_dma_sg(). Later on, if 'CONFIG_PM' is defined and the if > branch is taken, the execution will go to the label 'deferred'. However, > 'urb->sg' is not deallocated on this execution path, leading to a memory > leak bug. Just to make this clear: > Signed-off-by: Wenwen Wang NACK For the reason Jack explained. Deferral is not a failure. Regards Oliver