From patchwork Sat Jan 9 16:51:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Beregalov X-Patchwork-Id: 71941 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o09GpLdU023743 for ; Sat, 9 Jan 2010 16:51:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754698Ab0AIQvV (ORCPT ); Sat, 9 Jan 2010 11:51:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754679Ab0AIQvU (ORCPT ); Sat, 9 Jan 2010 11:51:20 -0500 Received: from mail-fx0-f225.google.com ([209.85.220.225]:54680 "EHLO mail-fx0-f225.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794Ab0AIQvU (ORCPT ); Sat, 9 Jan 2010 11:51:20 -0500 Received: by fxm25 with SMTP id 25so13439978fxm.21 for ; Sat, 09 Jan 2010 08:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=YrfeWkeF3wg3Dwhkgpb4RTGhPzvl4ol8AjjEm0l+nnM=; b=wl6ww5HE1040n2mm6LJ2N2INnpkZDjeaxLz71LDXLOpFlS62bP/QKMjNTjJS2VCUjO LMFLXYrgAzM0pJs37GJqLbDbnGBV3yMU1FAqDkE3xYK+olDBn3UqW1TXsJIY/1dS8dAF 6OX2CD32WI2D6lJG+9U+d2CRx00Ph1LXTaol4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=BUzUc+Bu6asCFPznJi88osSb3k+dI4NmzzBbWmOO+yuLvn7VrptvYCQ9G4BxYwY4Ph 3iajdAnd0YHNIy+JPOSVjt/xE6zcKO9ZHV+XIarEbA8GyOKO62wxsfQCsJg1Lqtqgj9P PP5AudIriyoz5jbC3LeYnQWqfmzBAP6tHM2og= Received: by 10.87.63.14 with SMTP id q14mr23914869fgk.44.1263055878487; Sat, 09 Jan 2010 08:51:18 -0800 (PST) Received: from localhost.localdomain (ppp91-78-19-229.pppoe.mtu-net.ru [91.78.19.229]) by mx.google.com with ESMTPS id d6sm2053992fga.29.2010.01.09.08.51.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 09 Jan 2010 08:51:17 -0800 (PST) From: Alexander Beregalov To: mchehab@infradead.org, linux-media@vger.kernel.org Cc: Alexander Beregalov Subject: [PATCH] V4L/DVB: ir: fix memory leak Date: Sat, 9 Jan 2010 19:51:14 +0300 Message-Id: <1263055874-31427-1-git-send-email-a.beregalov@gmail.com> X-Mailer: git-send-email 1.6.6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index bff7a53..684918e 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -422,8 +422,10 @@ int ir_input_register(struct input_dev *input_dev, ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * sizeof(struct ir_scancode), GFP_KERNEL); - if (!ir_dev->rc_tab.scan) + if (!ir_dev->rc_tab.scan) { + kfree(ir_dev); return -ENOMEM; + } IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n", ir_dev->rc_tab.size,