It can't be NULL in this code path. It can only be NULL when you first
select the metaslab group that you're going to attempt to allocate from.

- George

On Thu, Sep 8, 2016 at 10:26 AM, Andriy Gapon <[email protected]> wrote:

> 
> Can mg_next even be NULL?
> There is some code that checks for that condition and, thus, Coverity
> assumes
> that it can be true.  Based on that assumption it quite convincingly
> proves that
> there could be a NULL pointer dereference in metaslab_group_allocatable()
> where
> we have the following loop:
> 
> for (mgp = mg->mg_next; mgp != rotor; mgp = mgp->mg_next) {
>         ...
> }
> 
> --
> Andriy Gapon
> 



-------------------------------------------
openzfs-developer
Archives: https://www.listbox.com/member/archive/274414/=now
RSS Feed: https://www.listbox.com/member/archive/rss/274414/28015062-cce53afa
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=28015062&id_secret=28015062-f966d51c
Powered by Listbox: http://www.listbox.com

Reply via email to