On 11/21/2017 10:20 AM, Alex Sadovsky wrote:
Hi Heinrich and Heiko,

do you see anything strange in this code (it was more obvious before
the patch but it can still be spotted)? I should say that it's too
late to check for "file != NULL" after the "file->private_data"
dereference. Maybe it should look like this:
         if (file)
                 kfree(file->private_data);
         free(file);
shouldn't it?

Thanks for spotting this.

Probably we should fix it here:

        if (!file || !dentry || !dir) {
                printf("%s: Error, no memory for malloc!\n", __func__);
                err = -ENOMEM;
                goto out;
        }

Why should we first print
printf("%s: Error, no memory for malloc!\n", __func__);
and then
dbg_gen("cannot find next direntry, error %d", err);

Instead we should immediately return.

Regards

Heinrich
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to