Skip to content

Commit 4cb760b

Browse files
rth7680tytso
authored andcommitted
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 <[email protected]> Reviewed-by: Ard Biesheuvel <[email protected]> Signed-off-by: Richard Henderson <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 8dae77a commit 4cb760b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/s390/include/asm/archrandom.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ extern atomic64_t s390_arch_random_counter;
2121

2222
bool s390_arch_random_generate(u8 *buf, unsigned int nbytes);
2323

24-
static inline bool arch_get_random_long(unsigned long *v)
24+
static inline bool __must_check arch_get_random_long(unsigned long *v)
2525
{
2626
return false;
2727
}
2828

29-
static inline bool arch_get_random_int(unsigned int *v)
29+
static inline bool __must_check arch_get_random_int(unsigned int *v)
3030
{
3131
return false;
3232
}
3333

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)
3535
{
3636
if (static_branch_likely(&s390_arch_random_available)) {
3737
return s390_arch_random_generate((u8 *)v, sizeof(*v));
3838
}
3939
return false;
4040
}
4141

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)
4343
{
4444
if (static_branch_likely(&s390_arch_random_available)) {
4545
return s390_arch_random_generate((u8 *)v, sizeof(*v));

0 commit comments

Comments
 (0)