From patchwork Sat May 8 02:47:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 432592 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp871647jao; Fri, 7 May 2021 19:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9kCq5ilVjQX2zUMxjuWqsMFjZw85Gsmhg7eiNSTvHdjlJewmKmBYOVDuNvd1a2qFQ/hyZ X-Received: by 2002:a17:90a:288:: with SMTP id w8mr13770336pja.111.1620442083983; Fri, 07 May 2021 19:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620442083; cv=none; d=google.com; s=arc-20160816; b=zXIzyx3D/+6M1R+O2zY4cjBwgU0IPKfsWsbLC9gB29ZjHJk1j6/CpvaSi2aOUH/IuB CM7um6iHIqeN62xqIXGPWAhLwffNMON28IqqWXKJpURomkZF2Ecn9P5YL4eOGdAuqyqT iwukWij86Ci3KbqrqZiPUqS3lclEzh4WR+md1M9J54AYTcU2GeQYFzedki9ffZSLikIR PA6EfxdlS0h2hDI1UohqZbBRqo+09jfYB8sVqoxkLbGtpZNYggkmjBacl28e4KUPRB6A LJkXDzOFwu0r0QCinTaJI/ALAxolYBSqYdjE4zlrT1SLM08QTKNhihwyMP5ZrZuZMAhd nsDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WV7L/Q2T/gdHK+iiVRI5JJL0gNM2+SyjBsqL+1fLFQU=; b=cslim79pr9tXdI2heAZ9po+RUNRMWhVWA2GQ1MGnuyLt7XIDW9WPeQJq4YRHbbwhJY GMkM9Y5PN4H+WD+5TXRI6buNCo8FWOrPjj4nY8SaJBjcAbUJLH5RkkEgO1+A9RC+LlM0 dG2AysHJ1ERSt/H+FBKCNu5sqAJXTaDH7w6/s4Vt/DE24uimIUhK9W/PPG22oRL4OhwB 9UrijNGe6UErpX0lIgZdlCke9NuZjlNysoz7zP+Wo5kfF4JCNPqnr1NAAFZvMjt8/GZX bQGlAhfMKnsXheBKcGJSns0iYt+7B1SDyEtK2zMDADCLIlllvHQ2sqvhN05SUGELTSE2 5o4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si1586636pfh.155.2021.05.07.19.48.03; Fri, 07 May 2021 19:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbhEHCtD (ORCPT + 1 other); Fri, 7 May 2021 22:49:03 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:17155 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbhEHCtC (ORCPT ); Fri, 7 May 2021 22:49:02 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FcWqt19cGzncCN; Sat, 8 May 2021 10:44:42 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Sat, 8 May 2021 10:47:50 +0800 From: Zhen Lei To: Jiri Kosina , Benjamin Tissoires , Anssi Hannula , Dmitry Torokhov , linux-usb , linux-input , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] HID: pidff: fix error return code in hid_pidff_init() Date: Sat, 8 May 2021 10:47:37 +0800 Message-ID: <20210508024737.1927-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 224ee88fe395 ("Input: add force feedback driver for PID devices") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/hid/usbhid/hid-pidff.c | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index ea126c50acc3..3b4ee21cd811 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -1292,6 +1292,7 @@ int hid_pidff_init(struct hid_device *hid) if (pidff->pool[PID_DEVICE_MANAGED_POOL].value && pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) { + error = -EPERM; hid_notice(hid, "device does not support device managed pool\n"); goto fail;