Hi, On Mon, 11 Dec 2017 18:53:46 +0800 tien.fong.c...@intel.com wrote: > From: Tien Fong Chee <tien.fong.c...@intel.com> > [...} > +/* > + * Prepare firmware struct; > + * return -ve if fail. > + */ > +static int _request_firmware_prepare(struct firmware **firmware_p, > + const char *name, void *dbuf, > + size_t size, u32 offset) > +{ > + struct firmware *firmware = NULL; > + int ret = 0; > + > + *firmware_p = NULL; > Sigh. This is useless... > + if (!name || name[0] == '\0') > + ret = -EINVAL; > + unless you do a 'return -EINVAL' here!
> + *firmware_p = firmware = calloc(1, sizeof(*firmware)); > + > + if (!firmware) { > + printf("%s: calloc(struct firmware) failed\n", __func__); > + return -ENOMEM; > + } > + > + firmware->name = name; > + firmware->data = dbuf; > + firmware->size = size; > + firmware->offset = offset; > + > + return ret; > +} > + Lothar Waßmann _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot