Re: [PATCH 1/5] libkmod: Do not inititialize file->memory on open

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

 



On Thu, Jun 01, 2023 at 03:39:57PM -0700, Lucas De Marchi wrote:
> diff --git a/libkmod/libkmod-file.c b/libkmod/libkmod-file.c
> index b6a8cc9..1449c41 100644
> --- a/libkmod/libkmod-file.c
> +++ b/libkmod/libkmod-file.c
> @@ -421,6 +421,7 @@ struct kmod_elf *kmod_file_get_elf(struct kmod_file *file)
>  	if (file->elf)
>  		return file->elf;
>  
> +	kmod_file_load_contents(file);
>  	file->elf = kmod_elf_new(file->memory, file->size);
>  	return file->elf;
>  }

<-- snip -->

> @@ -491,6 +492,14 @@ error:
>  	return file;
>  }
>  
> +int kmod_file_load_contents(struct kmod_file *file)
> +{
> +	if (file->memory)
> +		return 0;
> +
> +	return file->ops->load(file);
> +}

Should be void if we are not really going to be using the return
value when we use this routine?

  Luis



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux