cifs: use standard token parser for mount options
Dan Carpenter
dan.carpenter at oracle.com
Wed Mar 28 05:31:46 MDT 2012
On Wed, Mar 28, 2012 at 12:13:01PM +0100, Sachin Prabhu wrote:
> Hello Dan,
>
> You are right.
>
> On Wed, 2012-03-28 at 13:45 +0300, Dan Carpenter wrote:
> > Hello Sachin Prabhu,
> >
> > This is a semi-automatic email about new static checker warnings.
> >
> > The patch 8830d7e07a5e: "cifs: use standard token parser for mount
> > options" from Mar 23, 2012, leads to the following Smatch complaint:
> >
> > fs/cifs/connect.c:1607 cifs_parse_mount_options()
> > error: we previously assumed 'value' could be null (see line 1568)
> >
> > fs/cifs/connect.c
> > 1567 value = strchr(data, '=');
> > 1568 if (value != NULL)
> > ^^^^^^^^^^^^^
> > Check.
>
> static const match_table_t cifs_mount_option_tokens = {
> ..
> { Opt_pass, "pass=%s" },
> { Opt_pass, "password=%s" },
> ..
> ^^^ The parser will only match Opt_pass if the token passed contains a
> '=' character so value cannot be NULL. That check for NULL is
> unnecessary and shouldn't be there. This is otherwise harmless.
>
Great. Could you send a patch to remove the unneeded check? Please
give me the Reported-by: tag, I am trying to catch up to Randy.
regards,
dan carpenter
More information about the samba-technical
mailing list