From patchwork Thu Sep 11 00:20:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roy.qing.li@gmail.com X-Patchwork-Id: 4881341 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 1022DC0338 for ; Thu, 11 Sep 2014 00:20:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0450A201C7 for ; Thu, 11 Sep 2014 00:20:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D03F920123 for ; Thu, 11 Sep 2014 00:20:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752896AbaIKAUV (ORCPT ); Wed, 10 Sep 2014 20:20:21 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:64947 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbaIKAUV (ORCPT ); Wed, 10 Sep 2014 20:20:21 -0400 Received: by mail-pa0-f42.google.com with SMTP id lj1so7509525pab.1 for ; Wed, 10 Sep 2014 17:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=X47l/ri5FuG8O3oBTMyEU8LaGEqFPvfPWrAFooWx2MI=; b=dKKOD4ZLdWrHqEgSCB0miYRO8sItZmqfVaxkPfM6WZZ6pZeJT5P09YvYbJI7PcdQOK bSQjvMztIx2hskNh+BCGBk8GyJAM9kkXZo22qdMdKWAtvVSr8FlDZxuPfrnmusAUwfjL 3sXcE9xIyouUI05uVlvxWmv6axCei1VR2WUbjZAtiUC0Pg/9fJuYJmr9FqLUE6O6sT8B FxCqPVm43+oyYvCUaSLn0j1iBdAb8dyet197CeyuJcukLm8BXPZfrq9CEgHVAaCH7QNP A9ogCm9v2V/xDq9dVDs5MFK+L2akJ3N2wMGv6xz28YSmQE3J5hcbA/effH2WIz3/t3Av y/3w== X-Received: by 10.70.34.136 with SMTP id z8mr1187348pdi.39.1410394820950; Wed, 10 Sep 2014 17:20:20 -0700 (PDT) Received: from localhost ([1.202.252.122]) by mx.google.com with ESMTPSA id ix8sm16457487pac.32.2014.09.10.17.20.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 10 Sep 2014 17:20:20 -0700 (PDT) From: roy.qing.li@gmail.com To: sage@inktank.com, ceph-devel@vger.kernel.org Subject: [PATCH] libceph: fix a memory leak in handle_watch_notify Date: Thu, 11 Sep 2014 08:20:21 +0800 Message-Id: <1410394821-13054-1-git-send-email-roy.qing.li@gmail.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=-9.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Li RongQing event_work should be freed when adding it to queue failed Signed-off-by: Li RongQing Reviewed-by: Alex Elder --- net/ceph/osd_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 30f6faf..1e1b4f1 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -2323,6 +2323,7 @@ static void handle_watch_notify(struct ceph_osd_client *osdc, event_work->opcode = opcode; if (!queue_work(osdc->notify_wq, &event_work->work)) { dout("WARNING: failed to queue notify event work\n"); + kfree(event_work); goto done_err; } }