Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390x: Mark archrandom.h functions __must_check

We must not use the pointer output without validating the
success of the random read.

Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200110145422.49141-11-broonie@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Richard Henderson and committed by
Theodore Ts'o
4cb760b0 8dae77ac

+4 -4
+4 -4
arch/s390/include/asm/archrandom.h
··· 21 21 22 22 bool s390_arch_random_generate(u8 *buf, unsigned int nbytes); 23 23 24 - static inline bool arch_get_random_long(unsigned long *v) 24 + static inline bool __must_check arch_get_random_long(unsigned long *v) 25 25 { 26 26 return false; 27 27 } 28 28 29 - static inline bool arch_get_random_int(unsigned int *v) 29 + static inline bool __must_check arch_get_random_int(unsigned int *v) 30 30 { 31 31 return false; 32 32 } 33 33 34 - static inline bool arch_get_random_seed_long(unsigned long *v) 34 + static inline bool __must_check arch_get_random_seed_long(unsigned long *v) 35 35 { 36 36 if (static_branch_likely(&s390_arch_random_available)) { 37 37 return s390_arch_random_generate((u8 *)v, sizeof(*v)); ··· 39 39 return false; 40 40 } 41 41 42 - static inline bool arch_get_random_seed_int(unsigned int *v) 42 + static inline bool __must_check arch_get_random_seed_int(unsigned int *v) 43 43 { 44 44 if (static_branch_likely(&s390_arch_random_available)) { 45 45 return s390_arch_random_generate((u8 *)v, sizeof(*v));