[rtems commit] flashdev.c: return error if both buffers are NULL

Joel Sherrill joel at rtems.org
Tue Jan 16 16:58:21 UTC 2024


Module:    rtems
Branch:    master
Commit:    a73b52d6a469c330d21e02ea8f82a05edce9fb73
Changeset: http://git.rtems.org/rtems/commit/?id=a73b52d6a469c330d21e02ea8f82a05edce9fb73

Author:    Bernd Moessner <berndmoessner80 at gmail.com>
Date:      Sun Jan  7 10:21:40 2024 +0100

flashdev.c: return error if both buffers are NULL

Updates #4981

---

 cpukit/dev/flash/flashdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/dev/flash/flashdev.c b/cpukit/dev/flash/flashdev.c
index 8363ac96b1..f39f8dde4d 100644
--- a/cpukit/dev/flash/flashdev.c
+++ b/cpukit/dev/flash/flashdev.c
@@ -320,7 +320,7 @@ static int rtems_flashdev_read_write(
   int status;
 
   if ( read_buff == NULL && write_buff == NULL ) {
-    return 0;
+    rtems_set_errno_and_return_minus_one( EINVAL );
   }
 
   /* Get flash address */



More information about the vc mailing list