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: 12517829 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 D8E0CC433EF for ; Sat, 25 Sep 2021 22:30:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AFA2604D2 for ; Sat, 25 Sep 2021 22:30:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9AFA2604D2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jBMjiumwRZIximgZ6lqqqW0XSlSJG+zcBFFjNiFYnYc=; b=DLScMHekbI6bD1 RKhRrDSmwsiJYLQ8rssEsT8ICFX4LZ30b0ROzfp3b7N6qjMz7vvwpZyCFlhMWr+wJ1+ULWYuMr3yY vMTbO7BoLm3hpBoeOrnyr7wp1ZB0sby59bfNCBkHvLJV1vZ2Z89mLzyg63bcUqo23RWB3la8EC/io LfnTmIL/NGuKFtMoH0suhPD0LJwX1yZZRaFiI1VaihhgNxUQr2fdCUInWGSpAkzWKz3ZT1C1ii0Md RAmScLogn6FAWptrSZpjv5V3/gozbv9jK5DL1ABpRntYWCTrxFCOw+KbKjOo9ozpyXV3d8LhnnkZ1 eQVvLe+yeUwLLafPb4kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUGAb-00HMHT-Ix; Sat, 25 Sep 2021 22:29:21 +0000 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUGAX-00HMGS-9R for linux-arm-kernel@lists.infradead.org; Sat, 25 Sep 2021 22:29:18 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210925_152917_486385_AFF9574F X-CRM114-Status: GOOD ( 12.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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) {