Skip to content

Commit d4b111f

Browse files
catSully012davem330
authored andcommitted
gve: Properly handle errors in gve_assign_qpl
Ignored errors would result in crash. Fixes: ede3fcf ("gve: Add support for raw addressing to the rx path") Signed-off-by: Catherine Sullivan <[email protected]> Signed-off-by: Jeroen de Borst <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 922aa9b commit d4b111f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/ethernet/google/gve/gve_rx.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,14 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx)
104104
if (!rx->data.page_info)
105105
return -ENOMEM;
106106

107-
if (!rx->data.raw_addressing)
107+
if (!rx->data.raw_addressing) {
108108
rx->data.qpl = gve_assign_rx_qpl(priv);
109+
if (!rx->data.qpl) {
110+
kvfree(rx->data.page_info);
111+
rx->data.page_info = NULL;
112+
return -ENOMEM;
113+
}
114+
}
109115
for (i = 0; i < slots; i++) {
110116
if (!rx->data.raw_addressing) {
111117
struct page *page = rx->data.qpl->pages[i];

0 commit comments

Comments
 (0)