diff mbox series

[2/2] Covscan Scan: Fixed a couple CLANG_WARNINGs

Message ID 20230104170855.19822-2-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series [1/2] Covscan Scan: Wrong Check of Return Value | expand

Commit Message

Steve Dickson Jan. 4, 2023, 5:08 p.m. UTC
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2151971
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 tools/nfsrahead/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve Dickson Jan. 11, 2023, 3:57 p.m. UTC | #1
On 1/4/23 12:08 PM, Steve Dickson wrote:
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2151971
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... (tag: nfs-utils-2-6-3-rc6)

steved.
> ---
>   tools/nfsrahead/main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/nfsrahead/main.c b/tools/nfsrahead/main.c
> index c83c6f7..8a11cf1 100644
> --- a/tools/nfsrahead/main.c
> +++ b/tools/nfsrahead/main.c
> @@ -167,7 +167,7 @@ int main(int argc, char **argv)
>   		if ((ret = get_device_info(argv[optind], &device)) == 0)
>   			break;
>   
> -	if (ret != 0) {
> +	if (ret != 0 || device.fstype == NULL) {
>   		xlog(D_GENERAL, "unable to find device %s\n", argv[optind]);
>   		goto out;
>   	}
diff mbox series

Patch

diff --git a/tools/nfsrahead/main.c b/tools/nfsrahead/main.c
index c83c6f7..8a11cf1 100644
--- a/tools/nfsrahead/main.c
+++ b/tools/nfsrahead/main.c
@@ -167,7 +167,7 @@  int main(int argc, char **argv)
 		if ((ret = get_device_info(argv[optind], &device)) == 0)
 			break;
 
-	if (ret != 0) {
+	if (ret != 0 || device.fstype == NULL) {
 		xlog(D_GENERAL, "unable to find device %s\n", argv[optind]);
 		goto out;
 	}