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

2020-08-25 Thread Souptick Joarder
On Thu, Jul 30, 2020 at 6:30 AM John Hubbard wrote: > > On 7/29/20 12:01 PM, 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 shoul

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

2020-07-29 Thread John Hubbard
On 7/29/20 12:01 PM, 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 till num_pages. Hi

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

2020-07-29 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

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

2020-06-30 Thread Souptick Joarder
On Mon, Jun 22, 2020 at 10:05 PM Souptick Joarder wrote: > > On Wed, Jun 17, 2020 at 8:22 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_f

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

2020-06-22 Thread Souptick Joarder
On Wed, Jun 17, 2020 at 8:22 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 v2] drivers/virt/fsl_hypervisor: Correcting error handling path

2020-06-16 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