X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Feventpoll.c;h=aec5c13f634177bab34f108e9f4891e300b873a3;hb=645ca708f936b2fbeb79e52d7823e3eb2c0905f8;hp=99368bda0261321290a6afa52ad74a797f79cd54;hpb=921974982a7aab561a1c3ff1763af7470874ba8e;p=mv-sheeva.git diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 99368bda026..aec5c13f634 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -930,8 +930,15 @@ errxit: * inside the main ready-list here. */ for (nepi = ep->ovflist; (epi = nepi) != NULL; - nepi = epi->next, epi->next = EP_UNACTIVE_PTR) - list_add_tail(&epi->rdllink, &ep->rdllist); + nepi = epi->next, epi->next = EP_UNACTIVE_PTR) { + /* + * If the above loop quit with errors, the epoll item might still + * be linked to "txlist", and the list_splice() done below will + * take care of those cases. + */ + if (!ep_is_linked(&epi->rdllink)) + list_add_tail(&epi->rdllink, &ep->rdllist); + } /* * We need to set back ep->ovflist to EP_UNACTIVE_PTR, so that after * releasing the lock, events will be queued in the normal way inside