Skip to content

Commit

Permalink
[S390] sclp: handle empty event buffers
Browse files Browse the repository at this point in the history
Handle a malformed hardware response which some versions of the
Support Element (SE) may present during SE restart and which otherwise
would result in an endless loop in function sclp_dispatch_evbufs.

Signed-off-by: Peter Oberparleiter <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
oberpar authored and Martin Schwidefsky committed Feb 19, 2009
1 parent ba95fd4 commit e2e5a0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/s390/char/sclp.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,11 @@ sclp_dispatch_evbufs(struct sccb_header *sccb)
rc = 0;
for (offset = sizeof(struct sccb_header); offset < sccb->length;
offset += evbuf->length) {
/* Search for event handler */
evbuf = (struct evbuf_header *) ((addr_t) sccb + offset);
/* Check for malformed hardware response */
if (evbuf->length == 0)
break;
/* Search for event handler */
reg = NULL;
list_for_each(l, &sclp_reg_list) {
reg = list_entry(l, struct sclp_register, list);
Expand Down

0 comments on commit e2e5a0f

Please sign in to comment.