Re: [PATCH v5 2/5] PCI/sysfs: Use return value from dsm_label_utf16s_to_utf8s() directly

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

 



Hi Joe,

[...]
> > -static void dsm_label_utf16s_to_utf8s(union acpi_object *obj, char *buf)
> > +static int dsm_label_utf16s_to_utf8s(union acpi_object *obj, char *buf)
> >  {
> >  	int len;
> > +
> >  	len = utf16s_to_utf8s((const wchar_t *)obj->buffer.pointer,
> >  			      obj->buffer.length,
> >  			      UTF16_LITTLE_ENDIAN,
> >  			      buf, PAGE_SIZE);
> 
> This should be PAGE_SIZE - 1 no?
> 
> >  	buf[len] = '\n';
> > +
> > +	return len;
> 
> return len + 1 ?

Good catch!

I left the original code as-is, and this old latent bug would remain
there.  I am glad you had a moment to review this new version.  Thank
you!

I will send v6 later and include this as separate patch per Bjorn's
request.

	Krzysztof



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux