Re: [PATCH 02/10] mm/hugetlb: make sure to get NULL when list is empty

2020-08-10 Thread Wei Yang
On Mon, Aug 10, 2020 at 01:28:46PM -0700, Mike Kravetz wrote: >On 8/7/20 7:28 AM, Wei Yang wrote: >> On Fri, Aug 07, 2020 at 08:49:51PM +0800, Baoquan He wrote: >>> On 08/07/20 at 05:12pm, Wei Yang wrote: list_first_entry() may not return NULL even when the list is empty. Let's make

Re: [PATCH 02/10] mm/hugetlb: make sure to get NULL when list is empty

2020-08-10 Thread Mike Kravetz
On 8/7/20 7:28 AM, Wei Yang wrote: > On Fri, Aug 07, 2020 at 08:49:51PM +0800, Baoquan He wrote: >> On 08/07/20 at 05:12pm, Wei Yang wrote: >>> list_first_entry() may not return NULL even when the list is empty. >>> >>> Let's make sure the behavior by using list_first_entry_or_null(), >>>

Re: [PATCH 02/10] mm/hugetlb: make sure to get NULL when list is empty

2020-08-09 Thread Baoquan He
On 08/07/20 at 10:28pm, Wei Yang wrote: > On Fri, Aug 07, 2020 at 08:49:51PM +0800, Baoquan He wrote: > >On 08/07/20 at 05:12pm, Wei Yang wrote: > >> list_first_entry() may not return NULL even when the list is empty. > >> > >> Let's make sure the behavior by using list_first_entry_or_null(), >

Re: [PATCH 02/10] mm/hugetlb: make sure to get NULL when list is empty

2020-08-07 Thread Wei Yang
On Fri, Aug 07, 2020 at 08:49:51PM +0800, Baoquan He wrote: >On 08/07/20 at 05:12pm, Wei Yang wrote: >> list_first_entry() may not return NULL even when the list is empty. >> >> Let's make sure the behavior by using list_first_entry_or_null(), >> otherwise it would corrupt the list. >> >>

Re: [PATCH 02/10] mm/hugetlb: make sure to get NULL when list is empty

2020-08-07 Thread Baoquan He
On 08/07/20 at 05:12pm, Wei Yang wrote: > list_first_entry() may not return NULL even when the list is empty. > > Let's make sure the behavior by using list_first_entry_or_null(), > otherwise it would corrupt the list. > > Signed-off-by: Wei Yang > --- > mm/hugetlb.c | 3 ++- > 1 file changed,

[PATCH 02/10] mm/hugetlb: make sure to get NULL when list is empty

2020-08-07 Thread Wei Yang
list_first_entry() may not return NULL even when the list is empty. Let's make sure the behavior by using list_first_entry_or_null(), otherwise it would corrupt the list. Signed-off-by: Wei Yang --- mm/hugetlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/hugetlb.c