get_gendisk grabs a reference on the disk and file operation, so this code will leak both of them while having absolutely no use for the gendisk itself. This effectively reverts commit 2df83fa4bce421f ("PM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format")
Unified · Split
| @@ -948,17 +948,6 @@ static int software_resume(void) · 947 unmodified lines | |||
| 948 | 948 | ||
| 949 | /* Check if the device is there */ | 949 | /* Check if the device is there */ |
| 950 | swsusp_resume_device = name_to_dev_t(resume_file); | 950 | swsusp_resume_device = name_to_dev_t(resume_file); |
| 951 | |||
| 952 | /* | ||
| 953 | * name_to_dev_t is ineffective to verify parition if resume_file is in | ||
| 954 | * integer format. (e.g. major:minor) | ||
| 955 | */ | ||
| 956 | if (isdigit(resume_file[0]) && resume_wait) { | ||
| 957 | int partno; | ||
| 958 | while (!get_gendisk(swsusp_resume_device, &partno)) | ||
| 959 | msleep(10); | ||
| 960 | } | ||
| 961 | |||
| 962 | if (!swsusp_resume_device) { | 951 | if (!swsusp_resume_device) { |
| 963 | /* | 952 | /* |
| 964 | * Some device discovery might still be in progress; we need | 953 | * Some device discovery might still be in progress; we need |