Skip to content

Commit 2cad6fa

Browse files
tomi-fonthenrikbrixandersen
authored andcommitted
secure_storage: remove NULL pointer checks
It is the caller's responsibility to ensure pointers are valid. Save on code size. Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent 972ebb6 commit 2cad6fa

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

subsys/secure_storage/src/its/implementation.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ psa_status_t secure_storage_its_set(secure_storage_its_caller_id_t caller_id, ps
161161
if (make_its_uid(caller_id, uid, &its_uid) != PSA_SUCCESS) {
162162
return PSA_ERROR_INVALID_ARGUMENT;
163163
}
164-
if (p_data == NULL && data_length != 0) {
165-
return PSA_ERROR_INVALID_ARGUMENT;
166-
}
167164
if (create_flags & ~SECURE_STORAGE_ALL_CREATE_FLAGS) {
168165
return PSA_ERROR_NOT_SUPPORTED;
169166
}
@@ -193,15 +190,11 @@ psa_status_t secure_storage_its_get(secure_storage_its_caller_id_t caller_id, ps
193190
if (make_its_uid(caller_id, uid, &its_uid) != PSA_SUCCESS) {
194191
return PSA_ERROR_INVALID_ARGUMENT;
195192
}
196-
if ((p_data == NULL && data_size != 0) || p_data_length == NULL) {
197-
return PSA_ERROR_INVALID_ARGUMENT;
198-
}
199193
if (data_size == 0) {
200194
*p_data_length = 0;
201195
return PSA_SUCCESS;
202196
}
203197

204-
205198
ret = get_stored_data(its_uid, stored_data, &stored_data_len);
206199
if (ret != PSA_SUCCESS) {
207200
return ret;
@@ -239,9 +232,6 @@ psa_status_t secure_storage_its_get_info(secure_storage_its_caller_id_t caller_i
239232
if (make_its_uid(caller_id, uid, &its_uid) != PSA_SUCCESS) {
240233
return PSA_ERROR_INVALID_ARGUMENT;
241234
}
242-
if (p_info == NULL) {
243-
return PSA_ERROR_INVALID_ARGUMENT;
244-
}
245235

246236
ret = get_entry(its_uid, sizeof(data), data, &p_info->size, &p_info->flags);
247237
if (ret == PSA_SUCCESS) {

0 commit comments

Comments
 (0)