[Forwarding to on-discuss as I doubt the right people are on osol-bugs]

Begin forwarded message:
> From: Chee Wai Yeung <cheewai.yeung at ap.natixis.com>
> Date: June 21, 2009 10:56:27 PM CDT
> To: opensolaris-bugs at opensolaris.org
> Subject: [osol-bugs] Is this a possible bug in vntsdvcc.c?
>
> 180           for (; ; ) {
>    181                        /* get the console to be deleted */
>    182                        (void) mutex_lock(&groupp->lock);
>    183
>    184                        /* clean up any deleted console in the group */
>    185                        if (groupp->conspq != NULL) {
>    186                                consp = vntsd_que_walk(groupp->conspq,
>    187                                    (el_func_t)find_clean_cons);
>    188                                if (consp == NULL) {
>    189                                        /* no more cons to delete */
>    190                                        (void) 
> mutex_unlock(&groupp->lock);
>    191                                        break;
>    192                                }
>    193
>    194                                /* remove console from the group */
>    195                                (void) vntsd_que_rm(&groupp->conspq, 
> consp);
>    196                                (void) mutex_unlock(&groupp->lock);
>    197
>    198                                /* clean up the console */
>    199                                cleanup_cons(consp);
>    200                        }
>    201
>    202                        /* delete group? */
>    203                        if (groupp->conspq == NULL) {
>    204                                /* no more console in the group delete 
> group */
>    205                                assert(groupp->vntsd);
>    206
>    207                                (void) mutex_lock(&groupp->vntsd->lock);
>    208                                (void) 
> vntsd_que_rm(&groupp->vntsd->grouppq,
>    209                                                    groupp);
>    210                                (void) 
> mutex_unlock(&groupp->vntsd->lock);
>    211
>    212                                /* clean up the group */
>    213                                vntsd_clean_group(groupp);
>    214                                break;
>    215                        }
>    216                }
>
> Line 182 has call to mutex_lock(&groupp->lock).
>
> If then line 185 returns NULL right away it goes to line 203. The  
> block does not call mutex_unlock for the lock &groupp->lock.
>
> Will this later result in a deadlock?



-- 
Shawn Walker

Reply via email to