Skip to content

Commit b9bc7b8

Browse files
Raul E Rangelgregkh
authored andcommitted
lkdtm/bugs: fix build error in lkdtm_EXHAUST_STACK
lkdtm/bugs.c:94:2: error: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Werror=format=] pr_info("Calling function with %d frame size to depth %d ...\n", ^ THREAD_SIZE is defined as a unsigned long, cast CONFIG_FRAME_WARN to unsigned long as well. Fixes: 24cccab ("lkdtm/bugs: Adjust recursion test to avoid elision") Cc: stable <[email protected]> Signed-off-by: Raul E Rangel <[email protected]> Acked-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 587f174 commit b9bc7b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/lkdtm/bugs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct lkdtm_list {
2222
* recurse past the end of THREAD_SIZE by default.
2323
*/
2424
#if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN > 0)
25-
#define REC_STACK_SIZE (CONFIG_FRAME_WARN / 2)
25+
#define REC_STACK_SIZE (_AC(CONFIG_FRAME_WARN, UL) / 2)
2626
#else
2727
#define REC_STACK_SIZE (THREAD_SIZE / 8)
2828
#endif
@@ -91,7 +91,7 @@ void lkdtm_LOOP(void)
9191

9292
void lkdtm_EXHAUST_STACK(void)
9393
{
94-
pr_info("Calling function with %d frame size to depth %d ...\n",
94+
pr_info("Calling function with %lu frame size to depth %d ...\n",
9595
REC_STACK_SIZE, recur_count);
9696
recursive_loop(recur_count);
9797
pr_info("FAIL: survived without exhausting stack?!\n");

0 commit comments

Comments
 (0)