From edfb52936d79406f1bfe763a5562106931100d8f Mon Sep 17 00:00:00 2001 From: pjht Date: Sun, 23 Aug 2020 17:34:24 -0500 Subject: [PATCH] initrd driver now properly handles a request to read more data than available --- initrd_drv/main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/initrd_drv/main.c b/initrd_drv/main.c index ddb17c8..154234a 100644 --- a/initrd_drv/main.c +++ b/initrd_drv/main.c @@ -19,13 +19,7 @@ void read(void* args) { rpc_deallocate_buf(args,state.sizeorpos); long max_data=initrd_size-pos; if (size>max_data) { - serial_print("Reading too much data from initrd\n"); - state.buf=NULL; - state.sizeorpos=0; - serialize_int(0,&state); - rpc_return(state.buf,state.sizeorpos); - free(state.buf); - pthread_exit(NULL); + size=max_data; } char* data=malloc(sizeof(char)*size); for (long i=0;i