forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/net/ethernet/dec/tulip/eeprom.c
....@@ -224,9 +224,7 @@
224224 return;
225225 }
226226
227
- mtable = kmalloc(sizeof(struct mediatable) +
228
- count * sizeof(struct medialeaf),
229
- GFP_KERNEL);
227
+ mtable = kmalloc(struct_size(mtable, mleaf, count), GFP_KERNEL);
230228 if (mtable == NULL)
231229 return; /* Horrible, impossible failure. */
232230 last_mediatable = tp->mtable = mtable;