Skip to content

Commit 8dae77a

Browse files
rth7680tytso
authored andcommitted
powerpc: Mark archrandom.h functions __must_check
We must not use the pointer output without validating the success of the random read. Acked-by: Michael Ellerman <[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 98dcfce commit 8dae77a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/powerpc/include/asm/archrandom.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66

77
#include <asm/machdep.h>
88

9-
static inline bool arch_get_random_long(unsigned long *v)
9+
static inline bool __must_check arch_get_random_long(unsigned long *v)
1010
{
1111
return false;
1212
}
1313

14-
static inline bool arch_get_random_int(unsigned int *v)
14+
static inline bool __must_check arch_get_random_int(unsigned int *v)
1515
{
1616
return false;
1717
}
1818

19-
static inline bool arch_get_random_seed_long(unsigned long *v)
19+
static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
2020
{
2121
if (ppc_md.get_random_seed)
2222
return ppc_md.get_random_seed(v);
2323

2424
return false;
2525
}
2626

27-
static inline bool arch_get_random_seed_int(unsigned int *v)
27+
static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
2828
{
2929
unsigned long val;
3030
bool rc;

0 commit comments

Comments
 (0)