]> git.baikalelectronics.ru Git - kernel.git/commit
AFS: Fix cache manager service handlers
authorDavid Howells <dhowells@redhat.com>
Wed, 21 May 2014 13:48:05 +0000 (14:48 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 21 May 2014 13:48:05 +0000 (14:48 +0100)
commit712bdde23137ca93418d97d17dd5d5d56f188638
treed7e2b13f2ff270892babb8bc01799d71aded154c
parentc2c9c4bf519364dd004f5bb7696b25616d923c3b
AFS: Fix cache manager service handlers

Fix the cache manager RPC service handlers.  The afs_send_empty_reply() and
afs_send_simple_reply() functions:

 (a) Kill the call and free up the buffers associated with it if they fail.

 (b) Return with call intact if it they succeed.

However, none of the callers actually check the result or clean up if
successful - and may use the now non-existent data if it fails.

This was detected by Dan Carpenter using a static checker:

The patch 1d83f55459ef: "[AF_RXRPC]: Make the in-kernel AFS
filesystem use AF_RXRPC." from Apr 26, 2007, leads to the following
static checker warning:
"fs/afs/cmservice.c:155 SRXAFSCB_CallBack()
 warn: 'call' was already freed."

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/cmservice.c
fs/afs/rxrpc.c