Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:Update
nvme-cli.15716
0005-ioctl-Fix-wrong-return-case-of-get_propert...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0005-ioctl-Fix-wrong-return-case-of-get_property.patch of Package nvme-cli.15716
From 44f1003c32c54cf6fa4c832d53f63dc761aeebe7 Mon Sep 17 00:00:00 2001 From: Minwoo Im <minwoo.im@samsung.com> Date: Wed, 24 Apr 2019 01:48:58 +0100 Subject: [PATCH 2/3] ioctl: Fix wrong return case of get_property If get_property_helper() succeeds in the first time, and then fails in the next time, then the ret value will not be updated to an error value. This patch removes 'ret' variable to make 'err' to return being updated everytime get_property_helper() invoked. Git-commit: 5b7506198a6872764a51e32363e219916e1e592e References: bsc#1173561 Signed-off-by: Minwoo Im <minwoo.im@samsung.com> --- nvme-ioctl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nvme-ioctl.c b/nvme-ioctl.c index f56c710..638b2b1 100644 --- a/nvme-ioctl.c +++ b/nvme-ioctl.c @@ -612,7 +612,7 @@ int nvme_get_property(int fd, int offset, uint64_t *value) int nvme_get_properties(int fd, void **pbar) { int offset, advance; - int err, ret = -EINVAL; + int err; int size = getpagesize(); *pbar = malloc(size); @@ -624,15 +624,13 @@ int nvme_get_properties(int fd, void **pbar) memset(*pbar, 0xff, size); for (offset = NVME_REG_CAP; offset <= NVME_REG_CMBSZ; offset += advance) { err = get_property_helper(fd, offset, *pbar + offset, &advance); - if (!err) - ret = 0; - else { + if (err) { free(*pbar); break; } } - return ret; + return err; } int nvme_set_property(int fd, int offset, int value) -- 2.13.7
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor