From patchwork Sat Apr 26 19:55:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toralf_F=C3=B6rster?= X-Patchwork-Id: 4069491 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A913FBFF02 for ; Sat, 26 Apr 2014 19:56:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD24B20251 for ; Sat, 26 Apr 2014 19:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8CEA20222 for ; Sat, 26 Apr 2014 19:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751293AbaDZT4I (ORCPT ); Sat, 26 Apr 2014 15:56:08 -0400 Received: from mout.gmx.net ([212.227.17.21]:57135 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751287AbaDZT4H (ORCPT ); Sat, 26 Apr 2014 15:56:07 -0400 Received: from n22.fritz.box ([85.177.150.164]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LaXmV-1XJomw2B2N-00mKUU; Sat, 26 Apr 2014 21:56:05 +0200 From: =?UTF-8?q?Toralf=20F=C3=B6rster?= To: linux-nfs@vger.kernel.org Cc: =?UTF-8?q?Toralf=20F=C3=B6rster?= Subject: [PATCH] fs/nfs/idmap.c: fix a Memory leak for variable desc Date: Sat, 26 Apr 2014 21:55:57 +0200 Message-Id: <1398542157-20159-1-git-send-email-toralf.foerster@gmx.de> X-Mailer: git-send-email 1.9.2 MIME-Version: 1.0 X-Provags-ID: V03:K0:nL32u+Xk0zTBnktoC0AXuKFM1XYsZrPLG0/Crpseh4Ya2H9SzfQ xQNP8VkgiQQuaEWUqvnyFPVaTPpiR2+y4kOPkxrhOyNE+f2aR5oWm3SdKACl/qjAIc7Y9RI aFWAFt7pGz6t7LJ6jXlmJ7ZydLtjgTFWaMUlLpvOHJwc8Am9dRdgKHBvy9j628JACSpI3/h chXz4fezv7lgaeraHZkIA== Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 Signed-off-by: Toralf Förster --- fs/nfs/idmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index 567983d..8eb4954 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c @@ -272,8 +272,10 @@ static struct key *nfs_idmap_request_key(const char *name, size_t namelen, ssize_t ret; ret = nfs_idmap_get_desc(name, namelen, type, strlen(type), &desc); - if (ret <= 0) + if (ret <= 0) { + kfree(desc); return ERR_PTR(ret); + } rkey = request_key(&key_type_id_resolver, desc, ""); if (IS_ERR(rkey)) {