Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp25010pxk; Tue, 15 Sep 2020 16:43:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzevA6Y+syK+ZXjcuV+pfekq0odcFz93Mi83NS4SSe3t0XBkqvUPbgP1BJDXeMQ74GeExa1 X-Received: by 2002:a17:906:7d5:: with SMTP id m21mr5438251ejc.538.1600213422380; Tue, 15 Sep 2020 16:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600213422; cv=none; d=google.com; s=arc-20160816; b=0QgCYAFedTBsFfiQ+Qt3c2QTmcQrgTnkboWka21jpGTP3RVIho6GISHbCCRc8Ft6dW rWtfgEt6o/CDvg1vYhYMwEROxGyi2rCSHggfBW757pNeUtaScEdkUUR9bTsYj6S9glqt NIr+xh+qE4hPFqQLuelBXa2D8jsLDMp4jlcbRkLFVhRvTxxB+sAdp5CqXQbMSxMU/LD2 RVBmIwkHqLD3v1x/IAFupIxdlpSGz3fclwA58aDUtr1bbllj3SqWTYuN/Tx9q5VCrVKd PDAZAEjag/lQIPT0g52PbLkA83GZgeRHpOeZonFyPU5yhUVQJtAq0RBFJc18XzY3XnUk AGxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IEfTKzCSfehB2b1FzPm48BXeOPWW6CBUJoUmlXWE1jE=; b=tSmR6KQvaJzjVQuPu9Y8RzQ9s1QG2Z8quU2gIMNVHf9RROF/XGAIcO4L/waWloOqKK VHlf//P+pGhtz7OgOOCa0zejwuA70ectXoE8tuE3+XlzYM1KB6UMhfyPJPpSOlEsGn4T 0wL+TM7HdwL24zDwgsle0SZ3duN0X1R88sta4qdjJdpTtFy9QFvmTcvuYjgK5n1ASy5P Rf48wZiBCghpF37NKL4mnHVY0e112x0oERc9x3N8meB8xUCINS1aDS9QJvqiRlUoPd+e fOQMWnPxfv6zIG8YAbHXfnTovpUUd88NEaa8S3YQDyb+uF7645bj4QzuBI1IUtUgXn2c ReYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnrs+7L+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si10487519edi.411.2020.09.15.16.43.20; Tue, 15 Sep 2020 16:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnrs+7L+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727480AbgIOXmO (ORCPT + 99 others); Tue, 15 Sep 2020 19:42:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:47670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbgIOOem (ORCPT ); Tue, 15 Sep 2020 10:34:42 -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 D461921D94; Tue, 15 Sep 2020 14:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179341; bh=XbwKwVJGhjg2g05fL+HKZshm0QMK9+MQv21YwmNwFIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnrs+7L+/cUIBBXXl16yb5oTZhWhxvopnGt7MipqV1FvtCkNHhtwwxgHM21SlzCEc y+ffM/gN4LLWdO63oHdgAXSrlhffqtgO3ndVcwmc6ngZq6fsdoG+BwkxSD7rpMupEy Fva/Jmn0J5Jm+Dqmu3DO4u4PGK882eodfOmR39WQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 21/78] NFC: st95hf: Fix memleak in st95hf_in_send_cmd Date: Tue, 15 Sep 2020 16:12:46 +0200 Message-Id: <20200915140634.607762500@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit f97c04c316d8fea16dca449fdfbe101fbdfee6a2 ] When down_killable() fails, skb_resp should be freed just like when st95hf_spi_send() fails. Signed-off-by: Dinghao Liu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/nfc/st95hf/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 01acb6e533655..c4b6e29c07192 100644 --- a/drivers/nfc/st95hf/core.c +++ b/drivers/nfc/st95hf/core.c @@ -981,7 +981,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, rc = down_killable(&stcontext->exchange_lock); if (rc) { WARN(1, "Semaphore is not found up in st95hf_in_send_cmd\n"); - return rc; + goto free_skb_resp; } rc = st95hf_spi_send(&stcontext->spicontext, skb->data, -- 2.25.1