check head in page_chain_del for every loop
PATCH 1/1 check head in page_chain_del for every loop
From: Ming Li <[email protected]>
there will be crash when we get a NULL head in loop.
Signed-off-by Ming Li <[email protected]>
--- drbd/drbd_receiver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drbd/drbd_receiver.c +2 -2
@@ -280,12 +280,12 @@ static struct page *page_chain_del(struct page **head, int count)BUG_ON (!head); page =READ_ONCE (*head); -if (!page) -return NULL ; do { n = count; rv_head = page; + if (!page) + return NULL; while (true) { tmp = page_chain_next(page); if (--n == 0)
Signature · 1 line
2.24.3 (Apple Git-128)