From patchwork Tue Aug 25 09:39:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javed Hasan X-Patchwork-Id: 257854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5CCFC433E4 for ; Tue, 25 Aug 2020 09:40:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A76A52075F for ; Tue, 25 Aug 2020 09:40:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="Jm0Fyogo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729609AbgHYJkM (ORCPT ); Tue, 25 Aug 2020 05:40:12 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:53376 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729454AbgHYJkI (ORCPT ); Tue, 25 Aug 2020 05:40:08 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07P9P0Pc029626 for ; Tue, 25 Aug 2020 02:40:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=2NYROm4t5xK/XZ93U0Si4K6atvPXiUUZC/UtlBA8YQI=; b=Jm0FyogodIXgGKWZuLhR+dOiYzOjf35eG7FlCrEoCm0Q3LVwD6kzi/PuBy6/OwXoxYZP IIU8x7e5SaQQq2BJiP08s9wG8wf3izaQwn6ZHGaavhuEfETwvtnw1xiDkBZo+NIoEPtN smIljgY3murOjPm0O/ciRGQxnG4S5KV8Z9w5UazphCV/yj148ihCSEdUjWaw/9yFaJra Ck06z1DTldoCkA23BKE/MIE44LJlMQFwHPn/Du1anbTksFq6frECAHXteW8O33UvFU/m ZXtXXvQKznYRYpGmEAZ8HjtrXzm3CiJSOTeSlA5Lb2aEwZxi1GSRnfVOnWEsi9Lfyro3 EQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3330qpkeh2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 25 Aug 2020 02:40:07 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 25 Aug 2020 02:40:06 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 25 Aug 2020 02:40:06 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 44EB23F704B; Tue, 25 Aug 2020 02:40:06 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 07P9e4hx019708; Tue, 25 Aug 2020 02:40:04 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 07P9e4t0019646; Tue, 25 Aug 2020 02:40:04 -0700 From: Javed Hasan To: CC: , , Subject: [PATCH] libfc: Fix for double freed. Date: Tue, 25 Aug 2020 02:39:40 -0700 Message-ID: <20200825093940.19612-1-jhasan@marvell.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-25_02:2020-08-24,2020-08-25 signatures=0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org -Fix added for '&fp->skb' double freed. Signed-off-by: Javed Hasan diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index d8cbc9c..e67abb1 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -634,8 +634,6 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp, fc_frame_free(fp); out: kref_put(&rdata->kref, fc_rport_destroy); - if (!IS_ERR(fp)) - fc_frame_free(fp); } /**