From patchwork Sat Sep 25 22:29:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 12517831 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E365C433EF for ; Sat, 25 Sep 2021 22:29:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F8CA6108E for ; Sat, 25 Sep 2021 22:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbhIYWaw (ORCPT ); Sat, 25 Sep 2021 18:30:52 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:36114 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbhIYWaw (ORCPT ); Sat, 25 Sep 2021 18:30:52 -0400 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 8B6AE41300; Sat, 25 Sep 2021 22:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632608955; bh=FVGeqnEgyMleC6sn0Ws28qWQcVVfK0CJvV5kQ6UxFIo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=YGD1e5CXoqJ16RoqSvLfkI9bxQrvTs9cbYGrQ/DLgo5+tnGFkBNVPCojma9BX7cE1 N8JOyerFdtP0z+TqsxP4dShQGUWmdNCw2rfLulCj4ZgxwjDXI3FHJIrO3Ayq53PVu8 rbOr38b54JMfEGVXh4tdmV+HHO3jDUIUiPmlrShADoobdatxszWmh6cjSjhHA6BMjN OoCqgqHLsfaqEChRJi8iz8iEaG1cFPLPfUiQG4mzRIvZ/1ADOPSjOZp4GWRIYRSdjy GkbN9MejD5YRmP17q79tq16D9WrhldiuM0XgiNlloTrjNllmhWtJNeU7h1ougKFlQm z0YXTDYeIPYww== From: Colin King To: Jiri Kosina , Benjamin Tissoires , Alexandre Torgue , linux-input@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][V2] HID:Thrustmaster: Initialized pointers with NULL rather than 0 Date: Sat, 25 Sep 2021 23:29:15 +0100 Message-Id: <20210925222915.182365-1-colin.king@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Colin Ian King Pointers twi and tm_wheel should be initialized with NULL rather than 0. Fix these. Signed-off-by: Colin Ian King --- V2: Fix tm_wheel too --- drivers/hid/hid-thrustmaster.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c index d44550aa8805..5bc9b7756183 100644 --- a/drivers/hid/hid-thrustmaster.c +++ b/drivers/hid/hid-thrustmaster.c @@ -205,7 +205,7 @@ static void thrustmaster_model_handler(struct urb *urb) struct tm_wheel *tm_wheel = hid_get_drvdata(hdev); uint16_t model = 0; int i, ret; - const struct tm_wheel_info *twi = 0; + const struct tm_wheel_info *twi = NULL; if (urb->status) { hid_err(hdev, "URB to get model id failed with error %d\n", urb->status); @@ -272,7 +272,7 @@ static void thrustmaster_remove(struct hid_device *hdev) static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_id *id) { int ret = 0; - struct tm_wheel *tm_wheel = 0; + struct tm_wheel *tm_wheel = NULL; ret = hid_parse(hdev); if (ret) {