]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Fix use of BUG()
authorDavid Howells <dhowells@redhat.com>
Tue, 9 Jun 2020 15:15:45 +0000 (16:15 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 9 Jun 2020 16:21:03 +0000 (17:21 +0100)
commit6a66484d1a0e3ef4c15969d13d57eedaee748a44
treec7a6d63bc4d08641ff1a488f114ea6fc7314f6f8
parent253bc36aa4f66067a6b03413a0a5d51394442877
afs: Fix use of BUG()

Fix afs_compare_addrs() to use WARN_ON(1) instead of BUG() and return 1
(ie. srx_a > srx_b).

There's no point trying to put actual error handling in as this should not
occur unless a new transport address type is allowed by AFS.  And even if
it does, in this particular case, it'll just never match unknown types of
addresses.  This BUG() was more of a 'you need to add a case here'
indicator.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
fs/afs/vl_alias.c