Blame SOURCES/899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d.patch
|
|
f6ed37 |
commit 899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d
|
|
|
f6ed37 |
Author: Aristeu Rozanski <arozansk@redhat.com>
|
|
|
f6ed37 |
Date: Thu Jan 19 08:45:57 2023 -0500
|
|
|
f6ed37 |
|
|
|
f6ed37 |
rasdaemon: ras-report: fix possible but unlikely file descriptor leak
|
|
|
f6ed37 |
|
|
|
f6ed37 |
Found with covscan.
|
|
|
f6ed37 |
|
|
|
f6ed37 |
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
|
|
|
f6ed37 |
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
|
|
|
f6ed37 |
|
|
|
f6ed37 |
---
|
|
|
f6ed37 |
ras-report.c | 12 ++++++------
|
|
|
f6ed37 |
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
f6ed37 |
|
|
|
f6ed37 |
--- rasdaemon-0.6.1.orig/ras-report.c 2023-01-23 11:36:20.972368760 -0500
|
|
|
f6ed37 |
+++ rasdaemon-0.6.1/ras-report.c 2023-01-23 11:36:23.236343267 -0500
|
|
|
f6ed37 |
@@ -374,7 +374,7 @@ if(rc < 0){
|
|
|
f6ed37 |
|
|
|
f6ed37 |
mc_fail:
|
|
|
f6ed37 |
|
|
|
f6ed37 |
- if(sockfd > 0){
|
|
|
f6ed37 |
+ if(sockfd >= 0){
|
|
|
f6ed37 |
close(sockfd);
|
|
|
f6ed37 |
}
|
|
|
f6ed37 |
|
|
|
f6ed37 |
@@ -424,7 +424,7 @@ if(rc < 0){
|
|
|
f6ed37 |
|
|
|
f6ed37 |
aer_fail:
|
|
|
f6ed37 |
|
|
|
f6ed37 |
- if(sockfd > 0){
|
|
|
f6ed37 |
+ if(sockfd >= 0){
|
|
|
f6ed37 |
close(sockfd);
|
|
|
f6ed37 |
}
|
|
|
f6ed37 |
|
|
|
f6ed37 |
@@ -473,7 +473,7 @@ rc = 0;
|
|
|
f6ed37 |
|
|
|
f6ed37 |
non_standard_fail:
|
|
|
f6ed37 |
|
|
|
f6ed37 |
- if(sockfd > 0){
|
|
|
f6ed37 |
+ if(sockfd >= 0){
|
|
|
f6ed37 |
close(sockfd);
|
|
|
f6ed37 |
}
|
|
|
f6ed37 |
|
|
|
f6ed37 |
@@ -518,7 +518,7 @@ rc = 0;
|
|
|
f6ed37 |
|
|
|
f6ed37 |
arm_fail:
|
|
|
f6ed37 |
|
|
|
f6ed37 |
- if(sockfd > 0){
|
|
|
f6ed37 |
+ if(sockfd >= 0){
|
|
|
f6ed37 |
close(sockfd);
|
|
|
f6ed37 |
}
|
|
|
f6ed37 |
|
|
|
f6ed37 |
@@ -564,7 +564,7 @@ if(rc < 0){
|
|
|
f6ed37 |
|
|
|
f6ed37 |
mce_fail:
|
|
|
f6ed37 |
|
|
|
f6ed37 |
- if(sockfd > 0){
|
|
|
f6ed37 |
+ if(sockfd >= 0){
|
|
|
f6ed37 |
close(sockfd);
|
|
|
f6ed37 |
}
|
|
|
f6ed37 |
|
|
|
f6ed37 |
@@ -609,7 +609,7 @@ if (rc < 0)
|
|
|
f6ed37 |
done = 1;
|
|
|
f6ed37 |
|
|
|
f6ed37 |
mf_fail:
|
|
|
f6ed37 |
- if (sockfd > 0)
|
|
|
f6ed37 |
+ if (sockfd >= 0)
|
|
|
f6ed37 |
close(sockfd);
|
|
|
f6ed37 |
|
|
|
f6ed37 |
if (done)
|