Re: [PATCH] remoteproc: Remove unneeded check in elf_strtbl_add()

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

 



…
> useless.

         because …?


> Fix this issue by removing unneeded check.

Another wording suggestion:
  Thus remove a redundant check.


…
> +++ b/drivers/remoteproc/remoteproc_elf_helpers.h
> @@ -107,7 +107,7 @@ static inline unsigned int elf_strtbl_add(const char *name, void *ehdr, u8 class
>  	shdr = ehdr + elf_size_of_hdr(class) + shstrndx * elf_size_of_shdr(class);
>  	strtab = ehdr + elf_shdr_get_sh_offset(class, shdr);
>  	idx = index ? *index : 0;
> -	if (!strtab || !name)
> +	if (!name)
>  		return 0;
…

How do you think about to perform the remaining null pointer check
as the first statement (because of input parameter validation in
this function implementation)?

Regards,
Markus





[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux