Search Linux Wireless

Re: [PATCH 16/34] brcmfmac: acpi: Add support for fetching Apple ACPI properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022/01/04 7:50, Andy Shevchenko wrote:
>     >     +       status = acpi_evaluate_object(adev->handle, "RWCV",
>     NULL, &buf);
>     >     +       o = buf.pointer;
>     >     +       if (!ACPI_FAILURE(status) && o && o->type ==
>     ACPI_TYPE_BUFFER &&
>     >     +           o->buffer.length >= 2) {
>     >     +               char *antenna_sku = devm_kzalloc(dev, 3,
>     GFP_KERNEL);
>     >     +
>     >     +               memcpy(antenna_sku, o->buffer.pointer, 2);
>     >
>     >
>     > NIH devm_kmemdup()?
> 
>     Not *quite*. I take the first two bytes of the returned buffer and turn
>     them into a null-terminated 3-byte string. kmemdup wouldn't
>     null-terminate or would copy too much, depending on length.
> 
> 
> 
> devm_kstrndup() then?
> 
>  

That doesn't seem to be a thing.


-- 
Hector Martin (marcan@xxxxxxxxx)
Public Key: https://mrcn.st/pub



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux