Re: [PATCH] virtio: vdpa: omit check return of g_malloc

2020-09-23 Thread Eric Blake
On 9/18/20 8:12 AM, Alex Bennée wrote: Li Qiang writes: Philippe Mathieu-Daudé 于2020年8月19日周三 下午11:07写道: On 8/19/20 4:43 PM, Li Qiang wrote: If g_malloc fails, the application will be terminated. Which we don't want... better to use g_try_malloc() instead? I don't think so. If g_malloc

Re: [PATCH] virtio: vdpa: omit check return of g_malloc

2020-09-23 Thread Laurent Vivier
Le 18/09/2020 à 14:53, Laurent Vivier a écrit : > On 19/08/2020 16:43, Li Qiang wrote: >> If g_malloc fails, the application will be terminated. >> No need to check the return value of g_malloc. >> >> Signed-off-by: Li Qiang >> --- >> hw/virtio/vhost-vdpa.c | 7 +-- >> 1 file changed, 1 inser

Re: [PATCH] virtio: vdpa: omit check return of g_malloc

2020-09-18 Thread Alex Bennée
Li Qiang writes: > If g_malloc fails, the application will be terminated. > No need to check the return value of g_malloc. > > Signed-off-by: Li Qiang I think this is fine because a failure to config the dev would just cause an error_report later and it's extremely unlikely you don't have eno

Re: [PATCH] virtio: vdpa: omit check return of g_malloc

2020-09-18 Thread Alex Bennée
Li Qiang writes: > Philippe Mathieu-Daudé 于2020年8月19日周三 下午11:07写道: >> >> On 8/19/20 4:43 PM, Li Qiang wrote: >> > If g_malloc fails, the application will be terminated. >> >> Which we don't want... better to use g_try_malloc() instead? > > I don't think so. If g_malloc return NULL it means a c

Re: [PATCH] virtio: vdpa: omit check return of g_malloc

2020-09-18 Thread Laurent Vivier
On 19/08/2020 16:43, Li Qiang wrote: > If g_malloc fails, the application will be terminated. > No need to check the return value of g_malloc. > > Signed-off-by: Li Qiang > --- > hw/virtio/vhost-vdpa.c | 7 +-- > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/hw/virtio/vhos

Re: [PATCH] virtio: vdpa: omit check return of g_malloc

2020-08-19 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年8月19日周三 下午11:07写道: > > On 8/19/20 4:43 PM, Li Qiang wrote: > > If g_malloc fails, the application will be terminated. > > Which we don't want... better to use g_try_malloc() instead? I don't think so. If g_malloc return NULL it means a critical situation I think termi

Re: [PATCH] virtio: vdpa: omit check return of g_malloc

2020-08-19 Thread Philippe Mathieu-Daudé
On 8/19/20 4:43 PM, Li Qiang wrote: > If g_malloc fails, the application will be terminated. Which we don't want... better to use g_try_malloc() instead? > No need to check the return value of g_malloc. > > Signed-off-by: Li Qiang > --- > hw/virtio/vhost-vdpa.c | 7 +-- > 1 file changed, 1

[PATCH] virtio: vdpa: omit check return of g_malloc

2020-08-19 Thread Li Qiang
If g_malloc fails, the application will be terminated. No need to check the return value of g_malloc. Signed-off-by: Li Qiang --- hw/virtio/vhost-vdpa.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 4580f3efd8..403