From patchwork Mon Aug 28 20:49:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaohua Li X-Patchwork-Id: 9926153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C39F760375 for ; Mon, 28 Aug 2017 20:49:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B76C02879D for ; Mon, 28 Aug 2017 20:49:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC23E287AE; Mon, 28 Aug 2017 20:49:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37C222879D for ; Mon, 28 Aug 2017 20:49:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751213AbdH1Utd (ORCPT ); Mon, 28 Aug 2017 16:49:33 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:35114 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbdH1Utd (ORCPT ); Mon, 28 Aug 2017 16:49:33 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7SKipow025954 for ; Mon, 28 Aug 2017 13:49:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=rb5qfjI21kCeFlPJ1fVaGGeAGLQuxEcEmcwBSyxGPQc=; b=IzMHJlyYqbKdxjb1myTfg4xTXcD6ZSwznnSpo8KdirUIzVe1c2x/jvdklzB/9ms42YGC X6fEKwdaXgM/PF+6HtGzVXjdQwN/QILrYmEsdgQ9DI4joJuqx3l0Z1p/jcaTMprv1Dkf kK43sbOO0/zCPWcksCxEqJXZjPU24g0xKIs= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2cmsfcg8xf-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 28 Aug 2017 13:49:32 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB14.TheFacebook.com (192.168.16.24) with Microsoft SMTP Server id 14.3.319.2; Mon, 28 Aug 2017 13:49:31 -0700 Received: from facebook.com (2401:db00:21:603d:face:0:19:0) by mx-out.facebook.com (10.102.107.99) with ESMTP id 64453bbe8c3211e7b40b0002c99293a0-cef20150 for ; Mon, 28 Aug 2017 13:49:31 -0700 Received: by devbig638.prn2.facebook.com (Postfix, from userid 11222) id 8B6B042409EA; Mon, 28 Aug 2017 13:49:31 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Shaohua Li Smtp-Origin-Hostname: devbig638.prn2.facebook.com To: CC: , Smtp-Origin-Cluster: prn2c22 Subject: [PATCH] block/nullb: delete unnecessary memory free Date: Mon, 28 Aug 2017 13:49:31 -0700 Message-ID: <9df1970109b84fc170530a5ffa5c07e4480e445f.1503953204.git.shli@fb.com> X-Mailer: git-send-email 2.9.5 X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-28_12:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 2984c86(nullb: factor disk parameters) has a typo. The nullb_device allocation/free is done outside of null_add_dev. The commit accidentally frees the nullb_device in error code path. Reported-by: Dan Carpenter Signed-off-by: Shaohua Li --- drivers/block/null_blk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 4d328e3..18f2cb3 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -1909,7 +1909,6 @@ static int null_add_dev(struct nullb_device *dev) out_free_nullb: kfree(nullb); out: - null_free_dev(dev); return rv; }