Hi Shinichiro,

On 2019/4/19 9:18, Shinichiro Kawasaki wrote:
> 
> I don't think so. The major scenario that read_file() returns NULL is fopen 
> fails to read /sys/dev/block/%s/partition. It indicates that the target 
> device 
> is not a partition device. The sys_path and following code is still valid for 
> the non-partition device.

I guess you mean the case that ../partition is not existed, right? so we should
check errno to confirm that?

> 
> The other minor read_file() NULL return scenario is strdup() failure because 
> of 
> memory shortage. Do you think f2fs-tools need strdup() return value check? If 
> you suggest it, I will update the patch.

Yes, I think we need to handle that as well.

Thanks,

> 
> Thanks!


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to