Deleted Added
full compact
28c28
< __FBSDID("$FreeBSD: head/sys/kern/kern_intr.c 195249 2009-07-01 17:20:07Z jhb $");
---
> __FBSDID("$FreeBSD: head/sys/kern/kern_intr.c 198134 2009-10-15 14:54:35Z jhb $");
527c527
< ih->ih_name = name;
---
> strlcpy(ih->ih_name, name, sizeof(ih->ih_name));
600c600
< ih->ih_name = name;
---
> strlcpy(ih->ih_name, name, sizeof(ih->ih_name));
667a668,722
> * Append a description preceded by a ':' to the name of the specified
> * interrupt handler.
> */
> int
> intr_event_describe_handler(struct intr_event *ie, void *cookie,
> const char *descr)
> {
> struct intr_handler *ih;
> size_t space;
> char *start;
>
> mtx_lock(&ie->ie_lock);
> #ifdef INVARIANTS
> TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
> if (ih == cookie)
> break;
> }
> if (ih == NULL) {
> mtx_unlock(&ie->ie_lock);
> panic("handler %p not find in interrupt event %p", cookie, ie);
> }
> #endif
> ih = cookie;
>
> /*
> * Look for an existing description by checking for an
> * existing ":". This assumes device names do not include
> * colons. If one is found, prepare to insert the new
> * description at that point. If one is not found, find the
> * end of the name to use as the insertion point.
> */
> start = index(ih->ih_name, ':');
> if (start == NULL)
> start = index(ih->ih_name, 0);
>
> /*
> * See if there is enough remaining room in the string for the
> * description + ":". The "- 1" leaves room for the trailing
> * '\0'. The "+ 1" accounts for the colon.
> */
> space = sizeof(ih->ih_name) - (start - ih->ih_name) - 1;
> if (strlen(descr) + 1 > space) {
> mtx_unlock(&ie->ie_lock);
> return (ENOSPC);
> }
>
> /* Append a colon followed by the description. */
> *start = ':';
> strcpy(start + 1, descr);
> intr_event_update(ie);
> mtx_unlock(&ie->ie_lock);
> return (0);
> }
>
> /*