[renesas-drivers:topic/renesas-overlays 23/108] drivers/of/dynamic.c:1076 of_changeset_add_property_stringf() error: potential null dereference 'str'. (kvasprintf returns null)

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git topic/renesas-overlays
head:   c991b7bbdc862ab5c1a7edf88d04105fa081e2fc
commit: e068b1eab7180587d15bbc55abdc5851b7f216dc [23/108] of: changesets: Introduce changeset helper methods

smatch warnings:
show-warning-context "warning-lines" files

vim +/str +1076 drivers/of/dynamic.c

  1050	
  1051	/**
  1052	 * of_changeset_add_property_stringf - Create a new formatted string property
  1053	 *
  1054	 * @ocs:	changeset pointer
  1055	 * @np:		device node pointer
  1056	 * @name:	name of the property
  1057	 * @fmt:	format of string property
  1058	 * ...		arguments of the format string
  1059	 *
  1060	 * Adds a string property to the changeset by making copies of the name
  1061	 * and the formatted value.
  1062	 *
  1063	 * Returns zero on success, a negative error value otherwise.
  1064	 */
  1065	int of_changeset_add_property_stringf(struct of_changeset *ocs,
  1066			struct device_node *np, const char *name, const char *fmt, ...)
  1067	{
  1068		va_list vargs;
  1069		char *str;
  1070		int ret;
  1071	
  1072		va_start(vargs, fmt);
  1073		str = kvasprintf(GFP_KERNEL, fmt, vargs);
  1074		va_end(vargs);
  1075	
> 1076		ret = of_changeset_add_property_string(ocs, np, name, str);
  1077	
  1078		kfree(str);
  1079		return ret;
  1080	}
  1081	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux