diff mbox series

[SRU,J,J:linux-bluefield,1/1] UBUNTU: SAUCE: scripts/pahole-flags.sh change return to exit 0

Message ID 20230928022501.14072-2-matthew.ruffell@canonical.com
State New
Headers show
Series [SRU,J,J:linux-bluefield,1/1] UBUNTU: SAUCE: scripts/pahole-flags.sh change return to exit 0 | expand

Commit Message

Matthew Ruffell Sept. 28, 2023, 2:25 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2035123

When building a kernel on a system without pahole installed, you
frequently see the message:

./scripts/pahole-flags.sh: line 7: return: can only `return' from a function or sourced script

This occurs due to a return being used in an if statement,
without being a part of a function.

The fix is Authored By Linus Torvalds and was present in a merge
commit, with no changelog mention and documented in lkml
discussion only. It was silently squashed into the Linux-stable
tree by Greg GH, although the Ubuntu kernel uses a cherry pick
from upstream with the bug.

Fixes: 9741e07ece7c ("kbuild: Unify options for BTF generation for vmlinux and modules")
Link: https://lore.kernel.org/lkml/CAHk-=wgdE6=ob5nF60GvRYAG24MKaJBGJf3jPufMe1k_UPBQTA@mail.gmail.com/
(backported from commit fc02cb2b37fe2cbf1d3334b9f0f0eab9431766c4)
[mruffell: partial backport from merge commit, added changelog]
Signed-off-by: Matthew Ruffell <matthew.ruffell@canonical.com>
---
 scripts/pahole-flags.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh
index 2b6deb402105..d38fa6d84d62 100755
--- a/scripts/pahole-flags.sh
+++ b/scripts/pahole-flags.sh
@@ -4,7 +4,7 @@ 
 extra_paholeopt=
 
 if ! [ -x "$(command -v ${PAHOLE})" ]; then
-	return
+	exit 0
 fi
 
 pahole_ver=$($(dirname $0)/pahole-version.sh ${PAHOLE})