From patchwork Mon Jun 30 09:45:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 4446981 Return-Path: X-Original-To: patchwork-ceph-devel@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 CB949BEEAA for ; Mon, 30 Jun 2014 09:46:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0877D202FE for ; Mon, 30 Jun 2014 09:46:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E28C9201BA for ; Mon, 30 Jun 2014 09:46:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755133AbaF3JqD (ORCPT ); Mon, 30 Jun 2014 05:46:03 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:37163 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753906AbaF3JqB (ORCPT ); Mon, 30 Jun 2014 05:46:01 -0400 Received: by mail-la0-f43.google.com with SMTP id e16so4715857lan.30 for ; Mon, 30 Jun 2014 02:45:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=1ywHTVQaovGblcT90tgi9GqQITYjAVsvGLmu+pL0KyM=; b=Zs0n/yCBO9ajWc+9tLlzi7+Uw1W9WoBYXvlO68nmvIOXccvuXxbBOahfCUd9OfaX2m CU7b5H9ZWfTBHzh6SlMRBULHCvTMbrDm/F8TEhx3ZOjHp9rmamAaAb0SsrFHdnP6Dgi4 09AuXTb0JE9iW56+GZN6mnNDz24TT2NdqQcQPo2n3/moPMZ/7XELR6CcIZLtfHrbtUrj kPsATGNc/R08f8/3b6A7shxWgWwWK6x2bl5+fR930Sfu5NcxU7GCeik3jS3rKREPPt0c 2norMtLEcOExqKCkgqbGg5I5vGcFff4YGpxFf1t/9HclclM8Z8EXXIU0x9PXSE5iYaaY wrFg== X-Gm-Message-State: ALoCoQljKCygMmMFkX1sdlb99A/y0PZ8us2KmUery7OXoxiV6I74Hu9GjD0BFqLuFijL7KIYVNbj X-Received: by 10.152.19.229 with SMTP id i5mr1369915lae.60.1404121559551; Mon, 30 Jun 2014 02:45:59 -0700 (PDT) Received: from localhost ([109.110.67.36]) by mx.google.com with ESMTPSA id q8sm22938658lbr.28.2014.06.30.02.45.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 30 Jun 2014 02:45:58 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH] rbd: do not leak image_id in rbd_dev_v2_parent_info() Date: Mon, 30 Jun 2014 13:45:56 +0400 Message-Id: <1404121556-4854-1-git-send-email-ilya.dryomov@inktank.com> X-Mailer: git-send-email 1.7.10.4 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 image_id is leaked if the parent happens to have been recorded already. Fix it. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder --- drivers/block/rbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d99aa81774f8..adedb393b374 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4072,6 +4072,8 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev) parent_spec->snap_id = snap_id; rbd_dev->parent_spec = parent_spec; parent_spec = NULL; /* rbd_dev now owns this */ + } else { + kfree(image_id); } /*