aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-02-26 19:29:35 +0100
committerPaul Kocialkowski <contact@paulk.fr>2014-02-26 19:29:35 +0100
commitdb9cb928daf02a4caf99f6c732221eb9e2d78243 (patch)
tree39f8036a5499ab476f411ffa9fe5ec9053199590
parent9dca17677f75952e16474bcbea5d700d66cac181 (diff)
downloadexternal_libsamsung-ipc-db9cb928daf02a4caf99f6c732221eb9e2d78243.zip
external_libsamsung-ipc-db9cb928daf02a4caf99f6c732221eb9e2d78243.tar.gz
external_libsamsung-ipc-db9cb928daf02a4caf99f6c732221eb9e2d78243.tar.bz2
rfs: Chunk size is not always greater than size
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--samsung-ipc/rfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samsung-ipc/rfs.c b/samsung-ipc/rfs.c
index 6f1cc3f..96d8bf0 100644
--- a/samsung-ipc/rfs.c
+++ b/samsung-ipc/rfs.c
@@ -577,7 +577,7 @@ void *ipc_nv_data_read(struct ipc_client *client, size_t size, size_t offset)
return NULL;
}
- data = file_data_read(path, size, chunk_size, offset);
+ data = file_data_read(path, size, chunk_size > size ? size : chunk_size, offset);
if (data == NULL) {
ipc_client_log(client, "Reading nv_data failed");
return NULL;
@@ -613,7 +613,7 @@ int ipc_nv_data_write(struct ipc_client *client, const void *data, size_t size,
goto error;
}
- rc = file_data_write(path, data, size, chunk_size, offset);
+ rc = file_data_write(path, data, size, chunk_size > size ? size : chunk_size, offset);
if (rc < 0) {
ipc_client_log(client, "Writing nv_data failed");
goto error;