From patchwork Fri Jan 12 14:34:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 187764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp214316dyc; Fri, 12 Jan 2024 06:35:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvvCZT+Q8H/goM692G9FsMSTsj2M4yAE4bL6fr9rqXHTfST6hf8o6NButLDg4teMksKWeF X-Received: by 2002:a17:903:110d:b0:1d4:f87f:8589 with SMTP id n13-20020a170903110d00b001d4f87f8589mr1002628plh.81.1705070108552; Fri, 12 Jan 2024 06:35:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705070108; cv=none; d=google.com; s=arc-20160816; b=GdtAFn2Fhah1YHWdK6+IUk1KlbzJXTdVErI1KzvBfq1ltS2yXcE8e4yAWgIuR/ZQyD 0js2kxrIjEvwweCRN68nCMZ7K2Ma2rMzSI7fn+l2F9R7Pomm9plq15cB2qJ5ELJYDmkQ 3rFUtLha0HFgINfuxPxxR0iL1VCtnVuXqkfTGSOjPvSTUfFArcB0RJMDchPD/PPpKoQg 2n/zsUf0hXAlZSQ9eWt6H8L365ui7TwuoB+iMdvTmYGLC6LsjZqL/DA9KfBwQD26bV4w h2aPKB6NHRNZdfGbERNa9igBNhE/Wq7SxmnsF/OYV8Vu6aSoqyYvuznu/yfwwToMZpAB OmbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=wMAozsps9KhdnPC0gC/CqjxcAys0VIF1YUv+72UuGdM=; fh=DALGjJbOS7KO3XVn0WOZJFdLxB0u3pYKMDoejaZavLE=; b=aAWgFW49c8h7GNMB1RZ+cCw556MzVRVNvsHNKDj40Z5NQ5XZc1a1vAaUkoz8GapR7A hm7wkpwL6Py5dAk2vBqkn05eD9qk9QicGU8UzPhJdn8ZKTdLepXtqJk8qTE6+X2lqq12 s+CdERRQVQ8ttIAfOf0USgVq+Iqx+cOPR7ml2Zz8o8Zrek7AUefxhQDDjD8Kvq/BfOva CUtFvpLOCoWop0cSl5oOXHcXFGQTydc6A+q57/0l8dHhz9jlIIZMu7DNgwjId9oFkuTj 8502A2oCfjFVsDHJdPcMNz/xC9LQzk6PKq5aUwYxbzeCZF4oyCuTbQitZNn0QJJbDyc9 zv/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QSxNKtH0; spf=pass (google.com: domain of linux-kernel+bounces-24758-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24758-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jv13-20020a170903058d00b001d5a9d377aesi806099plb.462.2024.01.12.06.35.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:35:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24758-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QSxNKtH0; spf=pass (google.com: domain of linux-kernel+bounces-24758-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24758-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1F5D2B23387 for ; Fri, 12 Jan 2024 14:34:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 195406E2B0; Fri, 12 Jan 2024 14:34:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QSxNKtH0" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 223C964CFF for ; Fri, 12 Jan 2024 14:34:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40e66315d93so6316215e9.2 for ; Fri, 12 Jan 2024 06:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705070057; x=1705674857; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=wMAozsps9KhdnPC0gC/CqjxcAys0VIF1YUv+72UuGdM=; b=QSxNKtH0L5ny97b8ubTtPuslm7pNmNynFnHnzGI/mk4exHOX4oaK6f/LzjXq4m4Pgg S2PttR0ATVEnHHRuqAQ/hszkFViYWkW29xxS4hpqduKzbbE0KmkTN7Bv+XmNrZOz922v JFt9J4fTpVVMk7QEygpR3hHUoDTzQF6Hi1SzEXFWh5877WesQ1pZ6W54e92A+k+74k5F Jg+MDlwuDGu0zpZKLXxXtpmimmiwuPU4zs2BQxsAZTZbqcpSOk4PanE6D5B81vvrkooY vTPWxCu5EgZV07p640BUWol6qiBj4+Rdb2B8oEw4atT+ZZjkmhyKJIOC3rxPd729dIxO A0zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705070057; x=1705674857; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wMAozsps9KhdnPC0gC/CqjxcAys0VIF1YUv+72UuGdM=; b=Ynj+EVfQIA/6X7UYc6Bfd+98+Wv9DcOJNwtsPv2iGHmETRTCUo42KaPwDVZLljdtOV XSBhyNFREj6ggzP0DwTQCL+4vIfRag3kmyJ+QTwH6W2Y0Xpa66HbFWwBA+W7eoxHklA9 rMY4DlwesPLYRoGXoLJUyJMVIOb5ARIaOjmIwwGXfsFETQDplHAECiOS525xi8cCS5hz DLf4CXjo/0Z03uElyqUQadoHEd/9ymlejstVNj9F6EWQmLnQRItmrNLB/RaVac+OeEr3 02YwMFO0zbHt8d5+JV2oFdC2qpj5XwQnfhLqHpvYUiInOAhcfaftO1R0A9D+i7xnJlBH 2pIg== X-Gm-Message-State: AOJu0Yz7bjghyQCJ0/4tnE+gtWLkdKyQ2npRXc4fbLv8jaOLiPriqNg1 MjysslP0CdqIgeKXMp+gAE0pdE6nNvHf9xde1q9f4tBd/jE= X-Received: by 2002:a05:600c:1705:b0:40e:4832:9fab with SMTP id c5-20020a05600c170500b0040e48329fabmr886892wmn.143.1705070057428; Fri, 12 Jan 2024 06:34:17 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id l17-20020a05600c1d1100b0040e4a2b36bfsm9849022wms.22.2024.01.12.06.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:34:17 -0800 (PST) Date: Fri, 12 Jan 2024 17:34:14 +0300 From: Dan Carpenter To: Jiri Kosina Cc: Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] HID: hid-steam: remove pointless error message Message-ID: <305898fb-6bd4-4749-806c-05ec51bbeb80@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787895593801086060 X-GMAIL-MSGID: 1787895593801086060 This error message doesn't really add any information. If modprobe fails then the user will already know what the error code is. In the case of kmalloc() it's a style violation to print an error message for that because kmalloc has it's own better error messages built in. Signed-off-by: Dan Carpenter --- drivers/hid/hid-steam.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c index b3c4e50e248a..59df6ead7b54 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -1109,10 +1109,9 @@ static int steam_probe(struct hid_device *hdev, return hid_hw_start(hdev, HID_CONNECT_DEFAULT); steam = devm_kzalloc(&hdev->dev, sizeof(*steam), GFP_KERNEL); - if (!steam) { - ret = -ENOMEM; - goto steam_alloc_fail; - } + if (!steam) + return -ENOMEM; + steam->hdev = hdev; hid_set_drvdata(hdev, steam); spin_lock_init(&steam->lock); @@ -1179,9 +1178,6 @@ static int steam_probe(struct hid_device *hdev, cancel_work_sync(&steam->work_connect); cancel_delayed_work_sync(&steam->mode_switch); cancel_work_sync(&steam->rumble_work); -steam_alloc_fail: - hid_err(hdev, "%s: failed with error %d\n", - __func__, ret); return ret; } From patchwork Fri Jan 12 14:35:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 187765 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp214585dyc; Fri, 12 Jan 2024 06:35:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoAePRwKJrhxo7OuP9DlgjUYxOgPU7aVcYXtdVvSQM0PJw5BYtD7BFG8CyINAqAq+rk8IC X-Received: by 2002:ac8:5f90:0:b0:429:cc96:8ec1 with SMTP id j16-20020ac85f90000000b00429cc968ec1mr1563186qta.26.1705070132708; Fri, 12 Jan 2024 06:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705070132; cv=none; d=google.com; s=arc-20160816; b=Y1IS7ESmpnU5UElxi+VRyTvqowrtlZ6oddeJzE31N2lEBggidXwf6I5wh/JosscdI3 xz/R8xAiFkuBAutgMN0yPf8HyvmIAbwUbne8eq1heGZhP/CegTmPnjS9wMdn/ryf5KXZ liMMBZAo1OEY6QskjXbwyNalyYxIexJpemd0r8AENRJPZuNJa3AWbBQ6RRDfphMs9/cY MfgZBo3tjC0qNPJIKTB2xWRg946JqSTWZABgbqPHECrAjvrx7+VHnnaoxH3zMXgLP2La a60nFZP6SqVGdGEh28EajJrN8gn6ox0CQetSqS66wSz8Zz/Gk2mlgwzXpupgWj0qJ3CU LQAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=Y95Jfas4yPMpMpOy2M2wHIojPX+ZKuNke1Ebmh6JQsU=; fh=3WLtCNLXywvgy4CSqyDZQ+su8FZtAyXQb8zF7k0IZGM=; b=M1tPIUvESk6wbvpzsGbzkI4Ml155KGMIVpIlDMs5jzmJ/8lHpL7dP2YCmZ0y1Trezb eMt43pW99bmcJy9aeJMGqYBPuYkkcYkTAFew2H+qAiLS1kJbIl7TFN4z/xOw8ihRgifT GYQKmJeKduNMydcZ3A/WuQk06PGH9u/elznyGrOfXwBTxLYxHWxKAG+xXQ5jXm4ozQwJ 3bqSHNoVWeHoSK1+CujIZ8qoReQMHgVoAVjG2N4uVK8sXNBVcwZANsWs+iFS23AB3BUK eM4riaiEz1oMKc5Iar7gA94MmI+eu/WyjBp5wsH3f0rZI8JvBBhfZ6Ts1rPjDc0aDH7G 0Rzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nvzGNpBb; spf=pass (google.com: domain of linux-kernel+bounces-24759-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24759-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f12-20020ac859cc000000b00429c5477711si3026697qtf.521.2024.01.12.06.35.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:35:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24759-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nvzGNpBb; spf=pass (google.com: domain of linux-kernel+bounces-24759-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24759-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 80F651C23895 for ; Fri, 12 Jan 2024 14:35:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64C866E2B4; Fri, 12 Jan 2024 14:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nvzGNpBb" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C9546A345 for ; Fri, 12 Jan 2024 14:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40e63bc90f2so9382425e9.2 for ; Fri, 12 Jan 2024 06:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705070110; x=1705674910; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Y95Jfas4yPMpMpOy2M2wHIojPX+ZKuNke1Ebmh6JQsU=; b=nvzGNpBb/QggawV0OZUTjf9VYCxKeVJAa+RE7Fls9OnS6P+uI1mV/o3Pr7kaSmlfhd cEksUFnc5LSafqYTs1zCj8+TaC12GxoqVxNCRg/em+0URqlvaScO9UbjUQJZUSm52xZN 7e4A6Fuu8H98dbv+G8NmdI6psx1qHl1ObdSOP9c0k/3scSsajY1Yo3y5w33Q8/nJBmYK 2q+8Fd+YLkJHQn1fFE69kjZo80xW8sHs1VIGhi1/s4o1c421w1TkBh/sZx7IqiqdUFRf yAhXHz02KVI6deJbztdmvP3lgqcek/arBdZ/5vs8LjhlzQ4t90GmFI4SaS0OGb+mnKaT caCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705070110; x=1705674910; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y95Jfas4yPMpMpOy2M2wHIojPX+ZKuNke1Ebmh6JQsU=; b=ghWvnRm+tAAqQdzGvmdrl6+G6+yn3lrXTxcSsMoPJrug5KQdbaIVtVI5hfoEZWBQXo 7LhfQlRGUtbZ7fQKp5hlZdRnDF1doH2LZ+tmLR/UXx2IR59rb1XuoskW0YMueMYLkdPQ qRBReXddVNsAeDUxnFdjrw96PdeWYwNk6OaXeMNt+XS1cBLrj6Ao1QYLRLZd9TPM1YLh 4wwJbxi3jsfzhGvLgG27xt2Swif7ihyB/QWRyqOcoYDglKXc52koIHnWri5uMOCO9XJ7 L9eb3aL/Q/OuuFFs20obN7BjGnv+yiPzGqvVqfDKhLSgO8eyZf4CvCBxTWuqgvKqMCup Dybw== X-Gm-Message-State: AOJu0YyiN39DC3ZUeBxpgv/xISohFl/jKlCt19Fmjj493KcZXsuPbxcV H//ws9jZ8BNzB6umY50p1Wfx331ui7jGzg== X-Received: by 2002:a1c:7c08:0:b0:40e:55bb:a0b8 with SMTP id x8-20020a1c7c08000000b0040e55bba0b8mr787274wmc.157.1705070110611; Fri, 12 Jan 2024 06:35:10 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id j28-20020a05600c1c1c00b0040e6726befcsm2090812wms.10.2024.01.12.06.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:35:10 -0800 (PST) Date: Fri, 12 Jan 2024 17:35:06 +0300 From: Dan Carpenter To: Vicki Pfau Cc: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2] HID: hid-steam: Fix cleanup in probe() Message-ID: <1fd87904-dabf-4879-bb89-72d13ebfc91e@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <305898fb-6bd4-4749-806c-05ec51bbeb80@moroto.mountain> X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787895619161373831 X-GMAIL-MSGID: 1787895619161373831 There are a number of issues in this code. First of all if steam_create_client_hid() fails then it leads to an error pointer dereference when we call hid_destroy_device(steam->client_hdev). Also there are a number of leaks. hid_hw_stop() is not called if hid_hw_open() fails for example. And it doesn't call steam_unregister() or hid_hw_close(). Fixes: 691ead124a0c ("HID: hid-steam: Clean up locking") Signed-off-by: Dan Carpenter Reviewed-by: Vicki Pfau --- This is just from static analysis and code review. I haven't tested it. I only included the fixes tag for the error pointer dereference. drivers/hid/hid-steam.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c index 59df6ead7b54..b08a5ab58528 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -1128,14 +1128,14 @@ static int steam_probe(struct hid_device *hdev, */ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDRAW); if (ret) - goto hid_hw_start_fail; + goto err_cancel_work; ret = hid_hw_open(hdev); if (ret) { hid_err(hdev, "%s:hid_hw_open\n", __func__); - goto hid_hw_open_fail; + goto err_hw_stop; } if (steam->quirks & STEAM_QUIRK_WIRELESS) { @@ -1151,33 +1151,37 @@ static int steam_probe(struct hid_device *hdev, hid_err(hdev, "%s:steam_register failed with error %d\n", __func__, ret); - goto input_register_fail; + goto err_hw_close; } } steam->client_hdev = steam_create_client_hid(hdev); if (IS_ERR(steam->client_hdev)) { ret = PTR_ERR(steam->client_hdev); - goto client_hdev_fail; + goto err_stream_unregister; } steam->client_hdev->driver_data = steam; ret = hid_add_device(steam->client_hdev); if (ret) - goto client_hdev_add_fail; + goto err_destroy; return 0; -client_hdev_add_fail: - hid_hw_stop(hdev); -client_hdev_fail: +err_destroy: hid_destroy_device(steam->client_hdev); -input_register_fail: -hid_hw_open_fail: -hid_hw_start_fail: +err_stream_unregister: + if (steam->connected) + steam_unregister(steam); +err_hw_close: + hid_hw_close(hdev); +err_hw_stop: + hid_hw_stop(hdev); +err_cancel_work: cancel_work_sync(&steam->work_connect); cancel_delayed_work_sync(&steam->mode_switch); cancel_work_sync(&steam->rumble_work); + return ret; }