Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5854604ybn; Sun, 29 Sep 2019 07:07:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxf4G7vuuxBQvfaxZsrjr4p2/JwgzJ1oUVsWklyXKuKaykUx7vrVg9MUJdoG10n57JjC5J X-Received: by 2002:a05:6402:1688:: with SMTP id a8mr14422296edv.225.1569766077761; Sun, 29 Sep 2019 07:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569766077; cv=none; d=google.com; s=arc-20160816; b=DC0/mOs2/pp9qYX6A6I28BVpMcHraNPocyGePUFmUxqiMGnkiC0CQl4JE2E6HGNI1U XYEUFbwwGbOkbe1yVdd94KtwQ8x5nx3lmkr7CRP33isQoDP+RXjoWDep6VKvbKzsnuYI 4SSG+cbNRtTjoA6B4iLeeHtWHQJyQ7f7EpHhW/UlF4735rKBbDsvmhtE990IbqjKiDl5 JRc8HSCZmFhed618hAwvcOyehGDFBFDaq7WVZyKLqPoFDeDWWEhVKxQD3FuK3Xbvyy4j 5TTcUnQReAZcrNRbeXw11ISOSAwVW5jcf4nVTc5eGNqXX62H+joHxqL2YiwVaMPIKjnM Ittw== 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=viuHPsLSKqTov23sEVBtqO88v/3x9xxpf48e+qLTqIQ=; b=C8AuSNIyBtRFUfdl1043X702uSw2cMPemnQhUw+nGLeka9zn6Y7C+FVULg1B6JvXxo 3/aBailxQvbUtJ/UnlDFkWfquTTrYlzXvbmZYA5IoiOZZiRli443mIKpEVZb8zNwis1U paf92uerQhZebVW6yACUZYb2DoVVmql1geSTim9e71UGl0+WiCXqWfJZ36DB66AEv/nD cIjr00ZV3iDzdzNIYoTp6sxP7qi45vk6Zq54q5pNT2W0IAB5QteXb2Ss7g0Y2njOEspl 8R4Gegt2v3XP9MpTFfkk/ZfOpFMvGka36qeI3+R5ps+q0J0AeiDdsP2vpp4XuAlZ6C5c xK/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bicrY9T+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d29si5100319edb.203.2019.09.29.07.07.33; Sun, 29 Sep 2019 07:07:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bicrY9T+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbfI2OE2 (ORCPT + 99 others); Sun, 29 Sep 2019 10:04:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:47096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730397AbfI2ODu (ORCPT ); Sun, 29 Sep 2019 10:03:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 AC9BF2190F; Sun, 29 Sep 2019 14:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765830; bh=YMOZpmrP05wrCsy3mE5emmfL/Ui/BFfGowo3UebEA00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bicrY9T+eMlrsv+XH0n5ZFvn/7TTQRyNtcBrContLrToj3cVSzOzNd9hGehi8lIkp A74YJCO68db4xYV22TGyjvF3ZUsTpb1QA2zixcUVqHmtpd28etKy0I+nyb5HndSlAW SwP1OV/wLbCp7gXWDmcvdtXNRThRz4NOSlIqF1mA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roderick Colenbrander , Jiri Kosina Subject: [PATCH 5.3 10/25] HID: sony: Fix memory corruption issue on cleanup. Date: Sun, 29 Sep 2019 15:56:13 +0200 Message-Id: <20190929135012.835786737@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135006.127269625@linuxfoundation.org> References: <20190929135006.127269625@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: Roderick Colenbrander commit 2bcdacb70327013ca2066bfcf2af1009eff01f1d upstream. The sony driver is not properly cleaning up from potential failures in sony_input_configured. Currently it calls hid_hw_stop, while hid_connect is still running. This is not a good idea, instead hid_hw_stop should be moved to sony_probe. Similar changes were recently made to Logitech drivers, which were also doing improper cleanup. Signed-off-by: Roderick Colenbrander CC: stable@vger.kernel.org Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-sony.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2811,7 +2811,6 @@ err_stop: sony_cancel_work_sync(sc); sony_remove_dev_list(sc); sony_release_device_id(sc); - hid_hw_stop(hdev); return ret; } @@ -2876,6 +2875,7 @@ static int sony_probe(struct hid_device */ if (!(hdev->claimed & HID_CLAIMED_INPUT)) { hid_err(hdev, "failed to claim input\n"); + hid_hw_stop(hdev); return -ENODEV; }