mm: kmsan: apply __must_check to non-void functions
authorAlexander Potapenko <glider@google.com>
Thu, 13 Apr 2023 13:12:22 +0000 (15:12 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 23:30:09 +0000 (16:30 -0700)
commitbb1508c24c9c361e6344308c8de2cb81d7f228ba
treead4b66cca163434ef00bdcaeede14d3ee0251f32
parent1cb9dc4b475c7418f925ab0c97b6750007d9f52e
mm: kmsan: apply __must_check to non-void functions

Non-void KMSAN hooks may return error codes that indicate that KMSAN
failed to reflect the changed memory state in the metadata (e.g.  it could
not create the necessary memory mappings).  In such cases the callers
should handle the errors to prevent the tool from using the inconsistent
metadata in the future.

We mark non-void hooks with __must_check so that error handling is not
skipped.

Link: https://lkml.kernel.org/r/20230413131223.4135168-3-glider@google.com
Signed-off-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Dipanjan Das <mail.dipanjan.das@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/kmsan.h