linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Coverity: darray_vprintf(): API usage errors
@ 2024-02-14  0:03 coverity-bot
  0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2024-02-14  0:03 UTC (permalink / raw)
  To: Kent Overstreet
  Cc: linux-bcachefs, linux-kernel, Darrick J. Wong, Andrew Morton,
	Brian Foster, Gustavo A. R. Silva, linux-next, linux-hardening

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20240213 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Mon Feb 12 13:55:16 2024 -0500
    ead021e0fe5b ("thread_with_file: Lift from bcachefs")

Coverity reported the following:

*** CID 1583634:  API usage errors  (VARARGS)
lib/thread_with_file.c:123 in darray_vprintf()
117     		va_copy(args2, args);
118
119     		len = vsnprintf(out->data + out->nr, darray_room(*out), fmt, args2);
120     	} while (len + 1 > darray_room(*out) && !darray_make_room_gfp(out, len + 1, gfp));
121
122     	out->nr += min(len, darray_room(*out));
vvv     CID 1583634:  API usage errors  (VARARGS)
vvv     "va_end" was not called for "args2".
123     }
124
125     void stdio_redirect_vprintf(struct stdio_redirect *stdio, bool nonblocking,
126     			    const char *fmt, va_list args)
127     {
128     	struct stdio_buf *buf = &stdio->output;

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1583634 ("API usage errors")
Fixes: ead021e0fe5b ("thread_with_file: Lift from bcachefs")

Thanks for your attention!

-- 
Coverity-bot

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-14  0:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14  0:03 Coverity: darray_vprintf(): API usage errors coverity-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).