Skip to content
Commit 310c8e40 authored by Calvin Owens's avatar Calvin Owens Committed by Martin K. Petersen
Browse files

mpt3sas: Ensure the connector_name string is NUL-terminated



We blindly trust the hardware to give us NUL-terminated strings, which
is a bad idea because it doesn't always do that. For example:

  [  481.184784] mpt3sas_cm0: 	enclosure level(0x0000), connector name(     \x3)

In this case, connector_name is four spaces. We got lucky here because
the 2nd byte beyond our character array happens to be a NUL. Fix this by
explicitly writing '\0' to the end of the string to ensure we don't run
off the edge of the world in printk().

Signed-off-by: default avatarCalvin Owens <calvinowens@fb.com>
Acked-by: default avatarChaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 29b4817d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment