mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
net/rocker: Remove the dead error handling
Memory allocation functions like world_alloc, desc_ring_alloc etc, they are all wrappers around g_malloc, g_new etc. But g_malloc and similar functions doesn't return null. Because they ignore the fact that g_malloc() of 0 bytes returns null. So error checks for these allocation failure are superfluous. Now, remove them entirely. Cc: jasowang@redhat.com Cc: jiri@resnulli.us Cc: armbru@redhat.com Cc: f4bug@amsat.org Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
6ce310b535
commit
107e4b352c
5 changed files with 6 additions and 87 deletions
|
@ -226,10 +226,6 @@ FpPort *fp_port_alloc(Rocker *r, char *sw_name,
|
|||
{
|
||||
FpPort *port = g_new0(FpPort, 1);
|
||||
|
||||
if (!port) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
port->r = r;
|
||||
port->index = index;
|
||||
port->pport = index + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue