diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/char/sclp.c | 5 | ||||
-rw-r--r-- | drivers/s390/char/sclp_cmd.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index 1fd8f2193ed8..4377e93a43d7 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c | |||
@@ -280,8 +280,11 @@ sclp_dispatch_evbufs(struct sccb_header *sccb) | |||
280 | rc = 0; | 280 | rc = 0; |
281 | for (offset = sizeof(struct sccb_header); offset < sccb->length; | 281 | for (offset = sizeof(struct sccb_header); offset < sccb->length; |
282 | offset += evbuf->length) { | 282 | offset += evbuf->length) { |
283 | /* Search for event handler */ | ||
284 | evbuf = (struct evbuf_header *) ((addr_t) sccb + offset); | 283 | evbuf = (struct evbuf_header *) ((addr_t) sccb + offset); |
284 | /* Check for malformed hardware response */ | ||
285 | if (evbuf->length == 0) | ||
286 | break; | ||
287 | /* Search for event handler */ | ||
285 | reg = NULL; | 288 | reg = NULL; |
286 | list_for_each(l, &sclp_reg_list) { | 289 | list_for_each(l, &sclp_reg_list) { |
287 | reg = list_entry(l, struct sclp_register, list); | 290 | reg = list_entry(l, struct sclp_register, list); |
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index 506390496416..77ab6e34a100 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/memory.h> | 19 | #include <linux/memory.h> |
20 | #include <asm/chpid.h> | 20 | #include <asm/chpid.h> |
21 | #include <asm/sclp.h> | 21 | #include <asm/sclp.h> |
22 | #include <asm/setup.h> | ||
22 | 23 | ||
23 | #include "sclp.h" | 24 | #include "sclp.h" |
24 | 25 | ||
@@ -474,6 +475,10 @@ static void __init add_memory_merged(u16 rn) | |||
474 | goto skip_add; | 475 | goto skip_add; |
475 | if (start + size > VMEM_MAX_PHYS) | 476 | if (start + size > VMEM_MAX_PHYS) |
476 | size = VMEM_MAX_PHYS - start; | 477 | size = VMEM_MAX_PHYS - start; |
478 | if (memory_end_set && (start >= memory_end)) | ||
479 | goto skip_add; | ||
480 | if (memory_end_set && (start + size > memory_end)) | ||
481 | size = memory_end - start; | ||
477 | add_memory(0, start, size); | 482 | add_memory(0, start, size); |
478 | skip_add: | 483 | skip_add: |
479 | first_rn = rn; | 484 | first_rn = rn; |