Re: [PATCH] drivers/virt/fsl_hypervisor: Correcting error handling path

2020-05-25 Thread Souptick Joarder
On Fri, May 22, 2020 at 6:24 PM Dan Carpenter wrote: > > On Thu, May 14, 2020 at 01:53:16AM +0530, Souptick Joarder wrote: > > First, when memory allocation for sg_list_unaligned failed, there > > is no point of calling put_pages() as we haven't pinned any pages. > > > > Second, if get_user_pages_

Re: [PATCH] drivers/virt/fsl_hypervisor: Correcting error handling path

2020-05-22 Thread Dan Carpenter
On Thu, May 14, 2020 at 01:53:16AM +0530, Souptick Joarder wrote: > First, when memory allocation for sg_list_unaligned failed, there > is no point of calling put_pages() as we haven't pinned any pages. > > Second, if get_user_pages_fast() failed we should unpinned num_pinned > pages, no point of

Re: [PATCH] drivers/virt/fsl_hypervisor: Correcting error handling path

2020-05-22 Thread Souptick Joarder
On Thu, May 14, 2020 at 1:45 AM Souptick Joarder wrote: > > First, when memory allocation for sg_list_unaligned failed, there > is no point of calling put_pages() as we haven't pinned any pages. > > Second, if get_user_pages_fast() failed we should unpinned num_pinned > pages, no point of checking

[PATCH] drivers/virt/fsl_hypervisor: Correcting error handling path

2020-05-13 Thread Souptick Joarder
First, when memory allocation for sg_list_unaligned failed, there is no point of calling put_pages() as we haven't pinned any pages. Second, if get_user_pages_fast() failed we should unpinned num_pinned pages, no point of checking till num_pages. This will address both. Signed-off-by: Souptick J