From patchwork Fri Sep 18 11:16:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7215301 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D44CE9F6CD for ; Fri, 18 Sep 2015 11:16:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED3452093F for ; Fri, 18 Sep 2015 11:16:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF0B02093C for ; Fri, 18 Sep 2015 11:16:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751278AbbIRLQm (ORCPT ); Fri, 18 Sep 2015 07:16:42 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34135 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbbIRLQl (ORCPT ); Fri, 18 Sep 2015 07:16:41 -0400 Received: by padhy16 with SMTP id hy16so49138795pad.1; Fri, 18 Sep 2015 04:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=MmZUIo/n5mMdB3a2mAB7MZfwUehEK3azUlF0VEMrKQ8=; b=N5X9G0C1a5eqJemNoiqIGcIVjeHz1jtZxoGe0qu0O4ECeRmxQnknUvZwGvA2FJg1Fp drzVxU4WiAAxhDaIOAyHdaG1uHXCf8CnrTW34pPnVbAC/Aaq/+9S8e1d53cV0swJoazO yDg6CehAfq59HJmXHVSGRyVIcpOT+dNuy9Bm6/vQ0F+XuDsUlo7RGLaFCEwPtlypZS4W TJqhol2VHIJ0GpAZJcj/wC7MbZJdVbn+YNtf7ZRc7g5tz7h5YTP70FbL9H+HRLiekYm2 uuHS1MJpetlYO2OZ/wayPibjdiX2MMFtFH3PN764K4scTg3gBdtACTlQPV7MZQkn4gIL KxwA== X-Received: by 10.68.98.194 with SMTP id ek2mr6615255pbb.152.1442575001254; Fri, 18 Sep 2015 04:16:41 -0700 (PDT) Received: from localhost.localdomain ([49.206.255.164]) by smtp.gmail.com with ESMTPSA id fu4sm8492309pbb.59.2015.09.18.04.16.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 04:16:40 -0700 (PDT) From: Sudip Mukherjee To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] fbdev: broadsheetfb: fix memory leak Date: Fri, 18 Sep 2015 16:46:32 +0530 Message-Id: <1442574992-31654-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On the error path we have missed releasing the firmware. Signed-off-by: Sudip Mukherjee --- drivers/video/fbdev/broadsheetfb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/broadsheetfb.c b/drivers/video/fbdev/broadsheetfb.c index 0e5fde1..ac1f41e 100644 --- a/drivers/video/fbdev/broadsheetfb.c +++ b/drivers/video/fbdev/broadsheetfb.c @@ -752,7 +752,7 @@ static ssize_t broadsheet_loadstore_waveform(struct device *dev, if ((fw_entry->size < 8*1024) || (fw_entry->size > 64*1024)) { dev_err(dev, "Invalid waveform\n"); err = -EINVAL; - goto err_failed; + goto err_fw; } mutex_lock(&(par->io_lock)); @@ -762,13 +762,15 @@ static ssize_t broadsheet_loadstore_waveform(struct device *dev, mutex_unlock(&(par->io_lock)); if (err < 0) { dev_err(dev, "Failed to store broadsheet waveform\n"); - goto err_failed; + goto err_fw; } dev_info(dev, "Stored broadsheet waveform, size %zd\n", fw_entry->size); return len; +err_fw: + release_firmware(fw_entry); err_failed: return err; }