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

Configure Feed

Select the types of activity you want to include in your feed.

swsusp: don't pass a stack address to blkdev_get_by_path

holder is just an on-stack pointer that can easily be reused by other calls,
replace it with a static variable that doesn't change.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230608110258.189493-12-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
c889d079 7ee34cbc

+3 -2
+3 -2
kernel/power/swap.c
··· 1510 1510 return error; 1511 1511 } 1512 1512 1513 + static void *swsusp_holder; 1514 + 1513 1515 /** 1514 1516 * swsusp_check - Check for swsusp signature in the resume device 1515 1517 */ ··· 1519 1517 int swsusp_check(bool snapshot_test) 1520 1518 { 1521 1519 int error; 1522 - void *holder; 1523 1520 fmode_t mode = FMODE_READ; 1524 1521 1525 1522 if (snapshot_test) 1526 1523 mode |= FMODE_EXCL; 1527 1524 1528 1525 hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, 1529 - mode, &holder, NULL); 1526 + mode, &swsusp_holder, NULL); 1530 1527 if (!IS_ERR(hib_resume_bdev)) { 1531 1528 set_blocksize(hib_resume_bdev, PAGE_SIZE); 1532 1529 clear_page(swsusp_header);