File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -978,7 +978,7 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
978
978
pending_idx = netbk -> pending_ring [index ];
979
979
page = xen_netbk_alloc_page (netbk , skb , pending_idx );
980
980
if (!page )
981
- return NULL ;
981
+ goto err ;
982
982
983
983
gop -> source .u .ref = txp -> gref ;
984
984
gop -> source .domid = vif -> domid ;
@@ -1000,6 +1000,17 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
1000
1000
}
1001
1001
1002
1002
return gop ;
1003
+ err :
1004
+ /* Unwind, freeing all pages and sending error responses. */
1005
+ while (i -- > start ) {
1006
+ xen_netbk_idx_release (netbk , frag_get_pending_idx (& frags [i ]),
1007
+ XEN_NETIF_RSP_ERROR );
1008
+ }
1009
+ /* The head too, if necessary. */
1010
+ if (start )
1011
+ xen_netbk_idx_release (netbk , pending_idx , XEN_NETIF_RSP_ERROR );
1012
+
1013
+ return NULL ;
1003
1014
}
1004
1015
1005
1016
static int xen_netbk_tx_check_gop (struct xen_netbk * netbk ,
You can’t perform that action at this time.
0 commit comments