Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp239015ybl; Fri, 16 Aug 2019 23:17:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNdMCp/YNlXea20l+n5uWWC6FxwfxETPCEROzjVGXjmjdY30pdphRSXipy1PvvKxM028A6 X-Received: by 2002:a17:90a:1aab:: with SMTP id p40mr10579641pjp.7.1566022659448; Fri, 16 Aug 2019 23:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566022659; cv=none; d=google.com; s=arc-20160816; b=QCpb8tfPIo352TIhxvPg+uXy3t0+JfGK0glYPKtl9KFpYYuL5OdAnu9zSkfx+si+Xy T2QzE7O6FNK7z6z3kJGVE7pBnjyhgsw+RFsNHMZBaCkFOWw58L93zwwXDyNd9EttVBQ9 6NcaoXSuwjJJHNWtykmV7lrggoKGWG2DnHiGgJvAZ5B0NJ5K2Q8jSb1BGGSdpklgrwMC 6YY7Fm91wLA0siCYSaE7qZaISNsAxEojJ3l8InGpRiYM8V0Gt/fMBcu09fgbZfKYSjqU i1ef5Vy7oDCtmOiAm+4sVMn1boECjwYuu91gQCLG63UqCR3h/1aOg1Nni1BlizeGAMTV UhTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=nSWcGHQFcez4uU+PGD8SyJWHkgtSsyU9F5EbfdiRyOY=; b=zF1fzE3GOS2xJNQASA5bKylkUoWiQipL8peSUmThzgN5MsN+1mZZmHjvixwZ9aeBTx LQMRpm85S2eMHT+F3WgzNDpGEL1vYCoTT1/FZ2EeDyUSXgsa4csSDCkphJ9pV7jBixlQ j+BEo9qj0f41OO92O/S8g0bkk/KsSwv7TkayA1uQFcOplogofM9uTW1SjScE8PqiyB4w YIuzaNSptOOzm9n2TXbDs3M5rCZ42N435kW40slvGluh52xlFMWI/RnHQBePwKe9VdaD I5xn0mfku2XSon2xPHsPEFelQxsI9JKxVdwprsd0eGIyVKogd+aNZYKgVmxgg6vja/9q ATtQ== 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 s28si5970538pfd.272.2019.08.16.23.17.25; Fri, 16 Aug 2019 23:17:39 -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 S1726128AbfHQGPF (ORCPT + 99 others); Sat, 17 Aug 2019 02:15:05 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:40525 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbfHQGPF (ORCPT ); Sat, 17 Aug 2019 02:15:05 -0400 Received: by mail-yw1-f66.google.com with SMTP id z64so2486655ywe.7; Fri, 16 Aug 2019 23:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nSWcGHQFcez4uU+PGD8SyJWHkgtSsyU9F5EbfdiRyOY=; b=GVbeND+VuCVsfCqmm1wM4PSvX7el6yjkvwS6KzIL56Xl4yqGHe+yY1n1xDAcJY5nDs EvJgTJrT3xrouThCnnY6lwbEOOtU6NnNXvO8b5Be1fBNio6+gwB0zeUgWmchalrB9TcK FUES05ADHO+2JIETLEGCso29eT2r+U/W3HSac+QjTvE6NzGhlspeXMjjFgWGVI2Yk2Fv xr8frR4XiAr/T8jNn56UOKukmFXRlQQw43iaNVcnr2QPS7av1xdOLI7Y7OCiAgdA99NM LuhKQluuD26lSal/LnNosCMk6NadrRBiYmCYh/f4ZvFAiLPm02OdBklVrCtSi9kMjkN9 9a6w== X-Gm-Message-State: APjAAAWfpjIP6wPdIyFARX2068dG0VNLaIHTHdBmh6m3GZwRBxsg2Vp7 Gth2uVBh9OsyE2jxSX0MsMg= X-Received: by 2002:a81:6286:: with SMTP id w128mr8746846ywb.272.1566022504556; Fri, 16 Aug 2019 23:15:04 -0700 (PDT) Received: from localhost.localdomain (24-158-240-219.dhcp.smyr.ga.charter.com. [24.158.240.219]) by smtp.gmail.com with ESMTPSA id g3sm1334310ywk.15.2019.08.16.23.15.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Aug 2019 23:15:03 -0700 (PDT) From: Wenwen Wang To: Wenwen Wang Cc: Mauro Carvalho Chehab , Hans Verkuil , Sakari Ailus , Alexandre Courbot , Kees Cook , Thomas Gleixner , linux-media@vger.kernel.org (open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] media: usb: cx231xx-417: fix a memory leak bug Date: Sat, 17 Aug 2019 01:14:54 -0500 Message-Id: <1566022496-4425-1-git-send-email-wenwen@cs.uga.edu> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In cx231xx_load_firmware(), 'p_buffer' is allocated through vmalloc() to hold the firmware. However, after the usage, it is not deallocated, leading to a memory leak bug. Signed-off-by: Wenwen Wang --- drivers/media/usb/cx231xx/cx231xx-417.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 2475f69..5e2e1fd 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1051,6 +1051,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev) p_current_fw = p_fw; vfree(p_current_fw); p_current_fw = NULL; + vfree(p_buffer); uninitGPIO(dev); release_firmware(firmware); dprintk(1, "Firmware upload successful.\n"); -- 2.7.4