Re: [PATCH v2 4/4] hwmon: (asus_rog_ryujin) Handle missing driver data

Guenter Roeck <[email protected]>
Newsgroups org.kernel.vger.linux-hwmon,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 8/11/26 16:39, Arie Miller wrote:
> Handles an issue reported by Sashiko where an id could
> be missing driver_data.
> 
> Link: https://lore.kernel.org/r/[email protected]
> Assisted-by: Codex:gpt-5.6-sol sparse
> Signed-off-by: Arie Miller <[email protected]>
> ---
>   drivers/hwmon/asus_rog_ryujin.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hwmon/asus_rog_ryujin.c b/drivers/hwmon/asus_rog_ryujin.c
> index 9b34c6e06bf7..702edb831394 100644
> --- a/drivers/hwmon/asus_rog_ryujin.c
> +++ b/drivers/hwmon/asus_rog_ryujin.c
> @@ -506,6 +506,9 @@ static int rog_ryujin_probe(struct hid_device *hdev, const struct hid_device_id
>   	struct rog_ryujin_data *priv;
>   	int ret;
>   
> +	if (!id->driver_data)
> +		return -EINVAL;
> +

This will need to be part of the first patch of the series.

Guenter

>   	priv = devm_kzalloc(&hdev->dev, sizeof(*priv), GFP_KERNEL);
>   	if (!priv)
>   		return -ENOMEM;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.