Commit 1699f98
scsi: ufs: Fix unexpected values from ufshcd_read_desc_param()
WB-related sysfs entries can be accessed even when an UFS device does not
support the feature. The descriptors which are not supported by the UFS
device may be wrongly reported when they are accessed from their
corrsponding sysfs entries. Fix it by adding a sanity check of parameter
offset against the actual decriptor length.
Link: https://lore.kernel.org/r/1603346348-14149-1-git-send-email-cang@codeaurora.org
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Acked-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent f361993 commit 1699f98
1 file changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3192 | 3192 | | |
3193 | 3193 | | |
3194 | 3194 | | |
3195 | | - | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
3196 | 3202 | | |
3197 | 3203 | | |
3198 | 3204 | | |
3199 | 3205 | | |
3200 | 3206 | | |
3201 | | - | |
| 3207 | + | |
3202 | 3208 | | |
3203 | 3209 | | |
3204 | 3210 | | |
| |||
3212 | 3218 | | |
3213 | 3219 | | |
3214 | 3220 | | |
3215 | | - | |
| 3221 | + | |
3216 | 3222 | | |
3217 | 3223 | | |
3218 | 3224 | | |
3219 | 3225 | | |
3220 | 3226 | | |
3221 | 3227 | | |
3222 | | - | |
| 3228 | + | |
3223 | 3229 | | |
3224 | 3230 | | |
3225 | 3231 | | |
| |||
3229 | 3235 | | |
3230 | 3236 | | |
3231 | 3237 | | |
3232 | | - | |
3233 | | - | |
3234 | | - | |
3235 | | - | |
3236 | | - | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
3237 | 3242 | | |
| 3243 | + | |
3238 | 3244 | | |
3239 | 3245 | | |
3240 | 3246 | | |
| |||
0 commit comments