Re: bug report: potential null dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 25 May 2010, Dan Carpenter wrote:
> Hello,
> 
> This is a Smatch thing.
> 
> fs/ceph/auth.c +220 ceph_handle_auth_reply(55) error: potential null derefence 'ac->ops'.
>    211                  /* set up (new) protocol handler? */
>    212                  if (ac->protocol && ac->protocol != protocol) {
>    213                          ac->ops->destroy(ac);
>    214                          ac->protocol = 0;
>    215                          ac->ops = NULL;
>                                 ^^^^^^^^^^^^^^^
> 	We set ac->ops to NULL here.
> 
>    216                  }
>    217                  if (ac->protocol != protocol) {
>    218                          ret = ceph_auth_init_protocol(ac, protocol);
>    219                          if (ret) {
>    220                                  pr_err("error %d on auth method %s init\n",
>    221                                         ret, ac->ops->name);
>                                                     ^^^^^^^^^^^^^^
> 	We dereference it here.  ceph_auth_init_protocol() can fail
> 	before re-assigning it.
> 
>    222                                  goto out;
>    223                          }
>    224                  }

Thanks, I've queued up a fix.

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux