Aha, probably 'str' was not null terminated, but dev->name of course is. Fixed the patch, hopefully kernel works once more.