lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 2 Nov 2021 23:50:00 +0100
From:   Hans de Goede <hdegoede@...hat.com>
To:     Daniel Thompson <daniel.thompson@...aro.org>
Cc:     Lee Jones <lee.jones@...aro.org>,
        Jingoo Han <jingoohan1@...il.com>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] backlight: lp855x: Add support ACPI enumeration

Hi Daniel,

Thank you for the quick review of this series.

On 11/2/21 13:22, Daniel Thompson wrote:
> On Mon, Nov 01, 2021 at 07:55:17PM +0100, Hans de Goede wrote:
>> The Xiaomi Mi Pad 2 tablet uses an ACPI enumerated LP8556 backlight
>> controller for its LCD-panel, with a Xiaomi specific ACPI HID of
>> "XMCC0001", add support for this.
>>
>> Note the new "if (id)" check also fixes a NULL pointer deref when a user
>> tries to manually bind the driver from sysfs.
>>
>> When CONFIG_ACPI is disabled acpi_match_device() will always return NULL,
>> so the lp855x_parse_acpi() call will get optimized away.
>>
>> Signed-off-by: Hans de Goede <hdegoede@...hat.com>
>> ---
>>  drivers/video/backlight/lp855x_bl.c | 70 ++++++++++++++++++++++++-----
>>  1 file changed, 60 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
>> index d1d27d5eb0f2..f075ec84acfb 100644
>> --- a/drivers/video/backlight/lp855x_bl.c
>> +++ b/drivers/video/backlight/lp855x_bl.c
>> @@ -338,10 +339,6 @@ static int lp855x_parse_dt(struct lp855x *lp)
>>  		return -EINVAL;
>>  	}
>>  
>> -	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
>> -	if (!pdata)
>> -		return -ENOMEM;
>> -
>>  	of_property_read_string(node, "bl-name", &pdata->name);
>>  	of_property_read_u8(node, "dev-ctrl", &pdata->device_control);
>>  	of_property_read_u8(node, "init-brt", &pdata->initial_brightness);
> 
> Shouldn't there be a removal of an `lp->pdata = pdata` from somewhere in
> this function?

Ack, fixed for v2.

>> @@ -379,8 +376,31 @@ static int lp855x_parse_dt(struct lp855x *lp)
>>  }
>>  #endif
>>  
>> +static int lp855x_parse_acpi(struct lp855x *lp)
>> +{
>> +	int ret;
>> +
>> +	/*
>> +	 * On ACPI the device has already been initialized by the firmware
> 
> Perhaps nitpicking but ideally I'd like "and is in register mode" here 
> since I presume it can also be assumed that everything with this HID
> has adopted that).

Nope not nitpicking, that is a good point, also fixed for v2.

Regards,

Hans

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ