summaryrefslogtreecommitdiffstats
path: root/storagehandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storagehandler.cpp')
-rw-r--r--storagehandler.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/storagehandler.cpp b/storagehandler.cpp
index d1392e6..6f97bef 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -595,6 +595,14 @@ ipmi_ret_t ipmi_storage_get_fru_inv_area_info(
ipmi_ret_t rc = IPMI_CC_OK;
const FruInvenAreaInfoRequest* reqptr =
reinterpret_cast<const FruInvenAreaInfoRequest*>(request);
+
+ auto iter = frus.find(reqptr->fruID);
+ if (iter == frus.end())
+ {
+ *data_len = 0;
+ return IPMI_CC_SENSOR_INVALID;
+ }
+
try
{
const auto& fruArea = getFruAreaData(reqptr->fruID);
@@ -614,7 +622,6 @@ ipmi_ret_t ipmi_storage_get_fru_inv_area_info(
rc = IPMI_CC_UNSPECIFIED_ERROR;
*data_len = 0;
log<level::ERR>(e.what());
- report<InternalFailure>();
}
return rc;
}
@@ -630,6 +637,14 @@ ipmi_ret_t ipmi_storage_read_fru_data(
reinterpret_cast<const ReadFruDataRequest*>(request);
auto resptr =
reinterpret_cast<ReadFruDataResponse*>(response);
+
+ auto iter = frus.find(reqptr->fruID);
+ if (iter == frus.end())
+ {
+ *data_len = 0;
+ return IPMI_CC_SENSOR_INVALID;
+ }
+
auto offset =
static_cast<uint16_t>(reqptr->offsetMS << 8 | reqptr->offsetLS);
try
@@ -658,7 +673,6 @@ ipmi_ret_t ipmi_storage_read_fru_data(
rc = IPMI_CC_UNSPECIFIED_ERROR;
*data_len = 0;
log<level::ERR>(e.what());
- report<InternalFailure>();
}
return rc;
}
OpenPOWER on IntegriCloud