Skip to contentSkip to conversation

kdbus: add connection, queue handling and message validation code

DISCUSSION Dan Carpenter 2 participants 2 messages Mar 17, 2015 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hello Daniel Mack,

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

ipc/kdbus/connection.c
1998 if (argv[1].item) {

  1999                  cancel_fd = fget(argv[1].item->fds[0]);
                                    ^^^^

fget() returns NULL on error.

  2000                  if (IS_ERR(cancel_fd)) {
  2001                          ret = PTR_ERR(cancel_fd);
  2002                          cancel_fd = NULL;
  2003                          goto exit;
  2004                  }
  2005  
  2006                  if (!cancel_fd->f_op->poll) {
  2007                          ret = -EINVAL;
  2008                          goto exit;
  2009                  }
  2010          }

regards,
dan carpenter

#1 lore raw

Hi Dan,

Quoted 6 lines · Dan Carpenter

Hello Daniel Mack,

The patch 5fc8dd5c84fc: "kdbus: add connection, queue handling and message validation code" from Sep 11, 2014, leads to the following static checker warning:

Quoted 8 lines
	ipc/kdbus/connection.c:2000 kdbus_cmd_send()
	warn: 'cancel_fd' isn't an ERR_PTR

ipc/kdbus/connection.c
1998 if (argv[1].item) {

  1999                  cancel_fd = fget(argv[1].item->fds[0]);
                                    ^^^^

fget() returns NULL on error.

Thanks for reporting this! Should be fixed with the patch I just sent out.

Best regards,
Daniel