Re: [PATCH v3 7/8] ACPI: property: Add support for parsing buffer property UUID

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

 



On Wed, May 25, 2022 at 04:01:22PM +0300, Sakari Ailus wrote:
> Add support for newly added buffer property UUID, as defined in the DSD
> guide.

...

> +	if (check_mul_overflow((size_t)properties->package.count,

Why do you need casting? Any issues on 32-bit compilation?

Looking at the below code snippets, it seems you also can have a local
copy with needed type and use it everywhere (as outer_package_count or so).
But first question first...

> +			       sizeof(*package) + sizeof(void *),
> +			       &alloc_size) ||
> +	    check_add_overflow(sizeof(*props) + sizeof(*package), alloc_size,
> +			       &alloc_size)) {
> +		acpi_handle_warn(handle,
> +				 "can't allocate memory for %u buffer props",
> +				 properties->package.count);
> +		return;
> +	}

...

> +		if (ACPI_FAILURE(status)) {
> +			acpi_handle_warn(handle,
> +					 "can't evaluate \"%s\" as buffer\n",
> +					 obj->string.pointer);

I'm wondering if better to use %*pE here to show the full data of the buffer.

> +			continue;
> +		}

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux