Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5854000ybn; Sun, 29 Sep 2019 07:07:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz127WJ7Rr/vJmeAHWm4HvOZqFYNZ0TEvVJZo7EFRPzm+rEU3mVas6FaBdBLdXUIxbr6DfL X-Received: by 2002:a50:f391:: with SMTP id g17mr13176414edm.163.1569766044280; Sun, 29 Sep 2019 07:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569766044; cv=none; d=google.com; s=arc-20160816; b=RVPggNZ97J9SSLepgyY+OIqvc9Iiwx57I+1IjllliceVP/L0t/RF83R69G+e4czxzq ZRY+qBotU4jz4sSB0yCx2fJWrjYSb+Vla63UvlWN/lRFBLGBXydahDzmsON/1TwNSSK7 F76UCMnrjgWBsl5JRU8CZ8ZP2pTul82FzXlzkKpeVZb6GcKPQ3dyFMMLY+wQZqApTISO eenQMxMSH3xgAmsIbkcHnVMWR+qW3RJE6wpFKIAVAWS2bKGIvl/Q4pVCUxW5jdXjF7+Y KWNjlsrpatbhiK5C3dC/imL6aI6h8hap2Y7xuJDa++U0O85QTeOifZSAjvmOify3kNZ7 uBYQ== 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=IKxcbhvd4UN5ca5Vkb2GE66EcXjj640/GXwiMyp/NGgukfL1z7c7yUPSY4yvdxYSOi SpsvZ5aADJD6JSzjGUx1wNj9jAUfYNSJvUYfIr8mmCSBcKNGtiDtW0TWSm6T3rl7tH+8 GjFxK2UUbbB9pxOAWkC+vehQmfENO3zK8t3yD2RF32zT7dJA8IbS6en9Tn1U0GR1jB9U 3q9N/56YpsHaVb2NoWY1KNid9QsjxII8HwvvYZWzrCOOnWv4ZE8XGsrNH7fhvfuduoo/ sv5sEpPY+SZdSQwVoNPj26oA2mNpYGkutH90ruuhoxXSolptLILqTrayQX8tYiDmxLOk yscQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r1SByyAC; 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 d19si5521759ejy.353.2019.09.29.07.06.59; Sun, 29 Sep 2019 07:07:24 -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=r1SByyAC; 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 S1729933AbfI2OAf (ORCPT + 99 others); Sun, 29 Sep 2019 10:00:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:42356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729217AbfI2OAb (ORCPT ); Sun, 29 Sep 2019 10:00:31 -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 C8DDF21882; Sun, 29 Sep 2019 14:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765630; bh=YMOZpmrP05wrCsy3mE5emmfL/Ui/BFfGowo3UebEA00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r1SByyACqXhTUqJHguXmw54kwXPW7U4XCXWsY6xe5iaQpx3klPMWtlNZtLkrfYkPS mZzQzMvWClQS7eL9IodpOIa2xCY90ZZZ9I8jbc8EDCXR2nTWctQwE+s5skINzN9ZNu nNLmNsoUsoLTD45lxP0stedO60lD69Xb22ikal40= 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.2 13/45] HID: sony: Fix memory corruption issue on cleanup. Date: Sun, 29 Sep 2019 15:55:41 +0200 Message-Id: <20190929135028.225785340@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135024.387033930@linuxfoundation.org> References: <20190929135024.387033930@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; }