Commit 2e3a747
mtd: spi-nor: Fix spi_nor_try_unlock_all()
Commit ff67592 ("mtd: spi-nor: Introduce spi_nor_set_mtd_info()")
moved all initialization of the mtd fields at the end of spi_nor_scan().
Normally, the mtd info is only needed for the mtd ops on the device,
with one exception: spi_nor_try_unlock_all(), which will also make use
of the mtd->size parameter. With that commit, the size will always be
zero because it is not initialized. Fix that by not using the size of
the mtd_info struct, but use the size from struct spi_nor_flash_parameter.
Fixes: ff67592 ("mtd: spi-nor: Introduce spi_nor_set_mtd_info()")
Cc: [email protected]
Reported-by: Jean-Marc Ranger <[email protected]>
Closes: https://lore.kernel.org/all/DM6PR06MB561177323DC5207E34AF2A06C547A@DM6PR06MB5611.namprd06.prod.outlook.com/
Tested-by: Jean-Marc Ranger <[email protected]>
Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Pratyush Yadav <[email protected]>
Signed-off-by: Pratyush Yadav <[email protected]>
Link: https://lore.kernel.org/r/[email protected]1 parent 12da2e6 commit 2e3a747
1 file changed
+8
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
81 | | - | |
| 79 | + | |
| 80 | + | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
| 85 | + | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| |||
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
| |||
183 | 181 | | |
184 | 182 | | |
185 | 183 | | |
186 | | - | |
| 184 | + | |
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
| |||
195 | 193 | | |
196 | 194 | | |
197 | 195 | | |
198 | | - | |
| 196 | + | |
199 | 197 | | |
200 | 198 | | |
201 | 199 | | |
202 | | - | |
| 200 | + | |
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
| |||
248 | 246 | | |
249 | 247 | | |
250 | 248 | | |
251 | | - | |
252 | 249 | | |
253 | 250 | | |
254 | 251 | | |
| |||
273 | 270 | | |
274 | 271 | | |
275 | 272 | | |
276 | | - | |
| 273 | + | |
277 | 274 | | |
278 | 275 | | |
279 | 276 | | |
| |||
285 | 282 | | |
286 | 283 | | |
287 | 284 | | |
288 | | - | |
| 285 | + | |
289 | 286 | | |
290 | 287 | | |
291 | 288 | | |
| |||
0 commit comments