| .. | .. |
|---|
| 20 | 20 | |
|---|
| 21 | 21 | struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe *cp) |
|---|
| 22 | 22 | { |
|---|
| 23 | | - struct mtd_info *mtd = NULL; |
|---|
| 23 | + struct mtd_info *mtd; |
|---|
| 24 | 24 | struct cfi_private *cfi; |
|---|
| 25 | 25 | |
|---|
| 26 | 26 | /* First probe the map to see if we have CFI stuff there. */ |
|---|
| .. | .. |
|---|
| 135 | 135 | * our caller, and copy the appropriate data into them. |
|---|
| 136 | 136 | */ |
|---|
| 137 | 137 | |
|---|
| 138 | | - retcfi = kmalloc(sizeof(struct cfi_private) + cfi.numchips * sizeof(struct flchip), GFP_KERNEL); |
|---|
| 138 | + retcfi = kmalloc(struct_size(retcfi, chips, cfi.numchips), GFP_KERNEL); |
|---|
| 139 | 139 | |
|---|
| 140 | 140 | if (!retcfi) { |
|---|
| 141 | 141 | kfree(cfi.cfiq); |
|---|