public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: mei: implement mei_cl_connect function
Date: Mon, 06 May 2013 14:28:51 +0000	[thread overview]
Message-ID: <20130506142851.GA10716@elgon.mountain> (raw)

Hello Tomas Winkler,

The patch 9f81abdac362: "mei: implement mei_cl_connect function" from 
Jan 8, 2013, leads to the following static checker warning:
"drivers/misc/mei/main.c:522 mei_ioctl_connect_client()
	 warn: check 'dev->me_clients[]' for negative offsets (-2)"

drivers/misc/mei/main.c
   490          /* find ME client we're trying to connect to */
   491          i = mei_me_cl_by_uuid(dev, &data->in_client_uuid);
   492          if (i >= 0 && !dev->me_clients[i].props.fixed_address) {
                    ^^^^^^
We check that i is not -ENOENT here.

   493                  cl->me_client_id = dev->me_clients[i].client_id;
   494                  cl->state = MEI_FILE_CONNECTING;
   495          }
   496  
   497          dev_dbg(&dev->pdev->dev, "Connect to FW Client ID = %d\n",
   498                          cl->me_client_id);
   499          dev_dbg(&dev->pdev->dev, "FW Client - Protocol Version = %d\n",
   500                          dev->me_clients[i].props.protocol_version);
                                ^^^^^^^^^^^^^^^^^^
But on the rest of the function -ENOENT is not handled as an error.

   501          dev_dbg(&dev->pdev->dev, "FW Client - Max Msg Len = %d\n",
   502                          dev->me_clients[i].props.max_msg_length);
   503  

regards,
dan carpenter


                 reply	other threads:[~2013-05-06 14:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130506142851.GA10716@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox