From patchwork Mon Sep 21 16:27:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309343 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=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 AC7C0C43466 for ; Mon, 21 Sep 2020 16:58:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69C8B2223E for ; Mon, 21 Sep 2020 16:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707490; bh=KyBewu4rqNQvL0E8Ij9C6evBSZUlxIIxfZdxMbppqz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jGO/yUl7oMPznNImfQdfKIrpnZxtx3Kb+DmMLhS1i+9z10gzI9bxRdU4XQjgemYdm eZk3LYcBGZs7NFjTgDi0+hk75X2D85gTRTYYMR8+vBWcSyi1IsjQnso5eaSqNf0G+N 6nDaeuFJVAnhKn57qwobjiugWOd9VGpVSbXQ4RCY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730221AbgIUQ5w (ORCPT ); Mon, 21 Sep 2020 12:57:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:46866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729274AbgIUQmj (ORCPT ); Mon, 21 Sep 2020 12:42:39 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2661523A34; Mon, 21 Sep 2020 16:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706558; bh=KyBewu4rqNQvL0E8Ij9C6evBSZUlxIIxfZdxMbppqz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zy/a0qHVC6aNH1qlHxByacf6ETBREfFmKlU8oWKa7CjUSO4pPhB9pG5jZdyDRmxAb A6k2tQYKtaY+PQq9xYjo5ZO3+9BTRds7OYRKbZpuNL3S6GTZ9Lm2rDdn2o3N3/pd8K h0sMLkh4Rz5mmT0VRTuZoq2pmF5imOQ46BUUFfjg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Javed Hasan , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 11/49] scsi: libfc: Fix for double free() Date: Mon, 21 Sep 2020 18:27:55 +0200 Message-Id: <20200921162035.181075189@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162034.660953761@linuxfoundation.org> References: <20200921162034.660953761@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Javed Hasan [ Upstream commit 5a5b80f98534416b3b253859897e2ba1dc241e70 ] Fix for '&fp->skb' double free. Link: https://lore.kernel.org/r/20200825093940.19612-1-jhasan@marvell.com Reported-by: Dan Carpenter Signed-off-by: Javed Hasan Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/libfc/fc_disc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 78cf5b32bca67..0b3f4538c1d4d 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -646,8 +646,6 @@ free_fp: fc_frame_free(fp); out: kref_put(&rdata->kref, fc_rport_destroy); - if (!IS_ERR(fp)) - fc_frame_free(fp); } /**