The patch
5fc8dd5c84fc: "kdbus: add connection, queue handling and
message validation code" from Sep 11, 2014, leads to the following
static checker warning:
ipc/kdbus/connection.c:2000 kdbus_cmd_send()
warn: 'cancel_fd' isn't an ERR_PTR
Fix this by checking for NULL pointers returned from fget().
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
if (argv[1].item) {
cancel_fd = fget(argv[1].item->fds[0]);
- if (IS_ERR(cancel_fd)) {
- ret = PTR_ERR(cancel_fd);
- cancel_fd = NULL;
+ if (!cancel_fd) {
+ ret = -EBADF;
goto exit;
}