From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] ti: common: board_detect: Return a valid empty string for un-initialized eeprom
Date: Thu, 13 Oct 2016 09:50:07 -0400 [thread overview]
Message-ID: <20161013135007.GI4990@bill-the-cat> (raw)
In-Reply-To: <20161011173905.26208-4-nm@ti.com>
On Tue, Oct 11, 2016 at 12:39:05PM -0500, Nishanth Menon wrote:
> Current logic for query of revision, board_name, config returns
> NULL. Users of these functions do a direct strncmp to compare.
> Unfortunately, as per conventions require two valid strings to compare
> against and the current implementation causes a crash when compared
> with NULL.
>
> We'd still like to maintain the simplistic usage of these APIs instead
> of redundant if (string) res=strncmp(fn(),"cmp",n); flowing all over
> the place.
>
> Hence, since the version, name and config is already pre-initialized
> with empty string, just dont check for invalid header in the first
> place and return the empty string to the caller.
>
> Reported-by: Brad Griffis <bgriffis@ti.com>
> Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161013/f4734b72/attachment.sig>
next prev parent reply other threads:[~2016-10-13 13:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-11 17:39 [U-Boot] [PATCH 0/3] ti: common: board_detect: basic fixes for blank eeprom Nishanth Menon
2016-10-11 17:39 ` [U-Boot] [PATCH 1/3] ti: common: board_detect: Replace hardcoded value with macro Nishanth Menon
2016-10-13 3:44 ` Lokesh Vutla
2016-10-13 13:42 ` Tom Rini
2016-11-02 14:25 ` [U-Boot] [U-Boot, " Tom Rini
2016-10-11 17:39 ` [U-Boot] [PATCH 2/3] ti: common: board_detect: Setup initial default value for config as well Nishanth Menon
2016-10-13 3:45 ` Lokesh Vutla
2016-10-13 13:43 ` Tom Rini
2016-11-02 14:26 ` [U-Boot] [U-Boot, " Tom Rini
2016-10-11 17:39 ` [U-Boot] [PATCH 3/3] ti: common: board_detect: Return a valid empty string for un-initialized eeprom Nishanth Menon
2016-10-13 3:45 ` Lokesh Vutla
2016-10-13 13:50 ` Tom Rini [this message]
2016-11-02 14:26 ` [U-Boot] [U-Boot, " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161013135007.GI4990@bill-the-cat \
--to=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox