From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F5C4C47089 for ; Thu, 27 May 2021 06:22:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30156610CC for ; Thu, 27 May 2021 06:22:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234375AbhE0GYA (ORCPT ); Thu, 27 May 2021 02:24:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:57976 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbhE0GX6 (ORCPT ); Thu, 27 May 2021 02:23:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622096544; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hl0khCFoLI0oRhRpVSDBmDjEyhT/A0eO1VQGtupP81w=; b=BvZ1wv+F+rlwWuPEutDMlhemGamH+w7VVOAiBFtZs1GvD915MfiqdPufur/RKl8HqGodps 2hV5+4IYJMB9l4WJB9Ag+pJYJrgSxdbiscruBbK19IfWTXFmVJsqKLGv5BckBIYRJk81s5 79UJ3/yx59H0JT/1tUseznBGKuTe9IQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622096544; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hl0khCFoLI0oRhRpVSDBmDjEyhT/A0eO1VQGtupP81w=; b=Q+35HxqAyk8iXept8b9IbPaapf1vAqqHC4gcCPpccJ7IyfydtYPf1hxGPqEKelUmPsigNv QHtDLICCvLEHR2AQ== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B02E3AC46; Thu, 27 May 2021 06:22:24 +0000 (UTC) Date: Thu, 27 May 2021 08:22:24 +0200 Message-ID: From: Takashi Iwai To: Dmitry Osipenko Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] Input: elants_i2c - Fix NULL dereference at probing In-Reply-To: References: <20210526194301.28780-1-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 May 2021 22:44:59 +0200, Dmitry Osipenko wrote: > > Hello all, > > 26.05.2021 23:19, Dmitry Torokhov пишет: > > Hi Takashi, > > > > On Wed, May 26, 2021 at 09:43:01PM +0200, Takashi Iwai wrote: > >> The recent change in elants_i2c driver to support more chips > >> introduced a regression leading to Oops at probing. The driver reads > >> id->driver_data, but the id may be NULL depending on the device type > >> the driver gets bound. > >> > >> Add a NULL check and falls back to the default EKTH3500. > > > > Thank you for the patch. I think my preference would be to switch to > > device_get_match_data() and annotate the rest of the match tables with > > proper controller types. > > Doesn't a NULL mean that elants_i2c_id[] table fails to match the ACPI > device name? What is the name then? I don't own the device, so we need to ask on (open)SUSE Bugzilla. > This could be two patches: > 1 - trivial fix that can be backported easily > 2 - switch to device_get_match_data() I guess 2 is easy enough to backport to 5.12.x. Let's see. thanks, Takashi