From: Tom Rini Date: Sun, 20 Aug 2017 19:29:15 -0400 Subject: [U-Boot] mtdparts: Fix various issues reported by Coverity In-Reply-To: <1502757747-17303-1-git-send-email-trini@konsulko.com> References: <1502757747-17303-1-git-send-email-trini@konsulko.com> Message-ID: <20170820232915.GS17193@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On Mon, Aug 14, 2017 at 08:42:27PM -0400, Tom Rini wrote: > Now that sandbox is building cmd/mtdparts.c Coverity has looked at the > code and found a number of issues. In index_partitions() it is possible > that part will be NULL, so re-work the checks and debug statements to > take this into account. We have a number of string buffers that we > print to in the exact size of, and use string functions on, so we need > to ensure they are large enough to be NULL terminated. In > device_parse() it is not possible for num_partitions to be 0 (we would > have hit a different error first) so remove logically dead code. > Finally, in parse_mtdparts() if we have an error we need to free the > memory allocated to dev. >=20 > Cc: Lothar Wa=C3=9Fmann > Cc: Maxime Ripard > Reported-by: Coverity (CID: 166334, 166333, 166332, 166329, 166328) > Signed-off-by: Tom Rini Applied to u-boot/master, thanks! --=20 Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: