All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: image-host.c: use correct variable for strerrno
@ 2020-11-13 14:15 Philippe Reynes
  2020-11-16 23:53 ` Simon Glass
  2020-11-20  1:38 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Reynes @ 2020-11-13 14:15 UTC (permalink / raw)
  To: u-boot

In the function get_random_data, strerrno is called with
the variable ret (which is the return of the function
clock_gettime). It should be called with errnor. This
commit fixes this mistake.

Reported-by: Coverity (CID: 312956)
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
---
 tools/image-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/image-host.c b/tools/image-host.c
index 7cef78eab8..24079b8a27 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -335,7 +335,7 @@ static int get_random_data(void *data, int size)
 	ret = clock_gettime(CLOCK_MONOTONIC, &date);
 	if (ret < 0) {
 		printf("%s: clock_gettime has failed (err=%d, str=%s)\n",
-		       __func__, ret, strerror(ret));
+		       __func__, ret, strerror(errno));
 		goto out;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] tools: image-host.c: use correct variable for strerrno
  2020-11-13 14:15 [PATCH] tools: image-host.c: use correct variable for strerrno Philippe Reynes
@ 2020-11-16 23:53 ` Simon Glass
  2020-11-20  1:38 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-11-16 23:53 UTC (permalink / raw)
  To: u-boot

Hi Philippe,

On Fri, 13 Nov 2020 at 07:15, Philippe Reynes
<philippe.reynes@softathome.com> wrote:
>
> In the function get_random_data, strerrno is called with
> the variable ret (which is the return of the function
> clock_gettime). It should be called with errnor. This
> commit fixes this mistake.
>
> Reported-by: Coverity (CID: 312956)
> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
> ---
>  tools/image-host.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] tools: image-host.c: use correct variable for strerrno
  2020-11-13 14:15 [PATCH] tools: image-host.c: use correct variable for strerrno Philippe Reynes
  2020-11-16 23:53 ` Simon Glass
@ 2020-11-20  1:38 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-11-20  1:38 UTC (permalink / raw)
  To: u-boot

On Fri, Nov 13, 2020 at 03:15:18PM +0100, Philippe Reynes wrote:

> In the function get_random_data, strerrno is called with
> the variable ret (which is the return of the function
> clock_gettime). It should be called with errnor. This
> commit fixes this mistake.
> 
> Reported-by: Coverity (CID: 312956)
> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201119/d090001d/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-20  1:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 14:15 [PATCH] tools: image-host.c: use correct variable for strerrno Philippe Reynes
2020-11-16 23:53 ` Simon Glass
2020-11-20  1:38 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.