Skip to content

Commit 80e4390

Browse files
rddunlapChristoph Hellwig
authored andcommitted
dma-debug: fix return value of __setup handlers
When valid kernel command line parameters dma_debug=off dma_debug_entries=100 are used, they are reported as Unknown parameters and added to init's environment strings, polluting it. Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc5 dma_debug=off dma_debug_entries=100", will be passed to user space. and Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc5 dma_debug=off dma_debug_entries=100 Return 1 from these __setup handlers to indicate that the command line option has been handled. Fixes: 59d3daa ("dma-debug: add kernel command line parameters") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru> Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Joerg Roedel <joro@8bytes.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: iommu@lists.linux-foundation.org Cc: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent f5ff79f commit 80e4390

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/dma/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ static __init int dma_debug_cmdline(char *str)
927927
global_disable = true;
928928
}
929929

930-
return 0;
930+
return 1;
931931
}
932932

933933
static __init int dma_debug_entries_cmdline(char *str)
@@ -936,7 +936,7 @@ static __init int dma_debug_entries_cmdline(char *str)
936936
return -EINVAL;
937937
if (!get_option(&str, &nr_prealloc_entries))
938938
nr_prealloc_entries = PREALLOC_DMA_DEBUG_ENTRIES;
939-
return 0;
939+
return 1;
940940
}
941941

942942
__setup("dma_debug=", dma_debug_cmdline);

0 commit comments

Comments
 (0)