From patchwork Tue Sep 1 15:07:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 310479 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=-13.0 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=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 C5B81C433E7 for ; Tue, 1 Sep 2020 15:37:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F49321582 for ; Tue, 1 Sep 2020 15:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974640; bh=cLkCh0TQ3r1z5Bof6eBuZFAV4BBLrF+5jl34LRuXq4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DU9DFI6Wr30Xmxpswn7AF9ykbqMZYdgz4rzAvrnT1S4h11M4l+idFfprynrXiuCIp AAMBsv3SAXdXWUe6IBcwdP9yRX6MBFZaJV0u2c9nxelwWAIfQUlwwoyxAz54wBAPHk 718HnzQU1Fg8ikPNxSke0NUNhuu6j3x8QZE/9/GY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728703AbgIAPhS (ORCPT ); Tue, 1 Sep 2020 11:37:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:45008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731287AbgIAPhM (ORCPT ); Tue, 1 Sep 2020 11:37:12 -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 DAAA620E65; Tue, 1 Sep 2020 15:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974632; bh=cLkCh0TQ3r1z5Bof6eBuZFAV4BBLrF+5jl34LRuXq4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o1IG8XRpAYxW5xG1q73L2Wpi8WAqTb9asQqCXBOUVPbz2tiyysuMy0xc/CsEBZaNn OVvTSWydoeIhW8t5YRl6ek2fP8D1nMvQM/oNzr8cDR9ZyM7DLug1MLgUdwHXi5XTTr OGv97K85aM+6wKod3Qrh6wx01hU5cK9wlsBWV8Rg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evgeny Novikov , Sasha Levin Subject: [PATCH 5.8 018/255] staging: rts5208: fix memleaks on error handling paths in probe Date: Tue, 1 Sep 2020 17:07:54 +0200 Message-Id: <20200901151001.652486270@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Evgeny Novikov [ Upstream commit 11507bf9a8832741db69efd32bf09a2ab26426bf ] rtsx_probe() allocates host, but does not free it on error handling paths. The patch adds missed scsi_host_put(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Link: https://lore.kernel.org/r/20200623141230.7258-1-novikov@ispras.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/rts5208/rtsx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index be0053c795b7a..937f4e732a75c 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -972,6 +972,7 @@ ioremap_fail: kfree(dev->chip); chip_alloc_fail: dev_err(&pci->dev, "%s failed\n", __func__); + scsi_host_put(host); scsi_host_alloc_fail: pci_release_regions(pci); return err;