if_media.c (92725) | if_media.c (98849) |
---|---|
1/* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */ | 1/* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */ |
2/* $FreeBSD: head/sys/net/if_media.c 92725 2002-03-19 21:54:18Z alfred $ */ | 2/* $FreeBSD: head/sys/net/if_media.c 98849 2002-06-26 03:37:47Z ken $ */ |
3 4/* 5 * Copyright (c) 1997 6 * Jonathan Stone and Jason R. Thorpe. All rights reserved. 7 * 8 * This software is derived from information provided by Matt Thomas. 9 * 10 * Redistribution and use in source and binary forms, with or without --- 287 unchanged lines hidden (view full) --- 298 */ 299 if (ifmr->ifm_count > usermax) 300 ifmr->ifm_count = usermax; 301 else if (ifmr->ifm_count < 0) 302 return (EINVAL); 303 304 if (ifmr->ifm_count != 0) { 305 kptr = (int *)malloc(ifmr->ifm_count * sizeof(int), | 3 4/* 5 * Copyright (c) 1997 6 * Jonathan Stone and Jason R. Thorpe. All rights reserved. 7 * 8 * This software is derived from information provided by Matt Thomas. 9 * 10 * Redistribution and use in source and binary forms, with or without --- 287 unchanged lines hidden (view full) --- 298 */ 299 if (ifmr->ifm_count > usermax) 300 ifmr->ifm_count = usermax; 301 else if (ifmr->ifm_count < 0) 302 return (EINVAL); 303 304 if (ifmr->ifm_count != 0) { 305 kptr = (int *)malloc(ifmr->ifm_count * sizeof(int), |
306 M_TEMP, M_WAITOK); | 306 M_TEMP, M_NOWAIT); |
307 | 307 |
308 if (kptr == NULL) 309 return (ENOMEM); |
|
308 /* 309 * Get the media words from the interface's list. 310 */ 311 ep = LIST_FIRST(&ifm->ifm_list); 312 for (; ep != NULL && count < ifmr->ifm_count; 313 ep = LIST_NEXT(ep, ifm_list), count++) 314 kptr[count] = ep->ifm_media; 315 --- 194 unchanged lines hidden --- | 310 /* 311 * Get the media words from the interface's list. 312 */ 313 ep = LIST_FIRST(&ifm->ifm_list); 314 for (; ep != NULL && count < ifmr->ifm_count; 315 ep = LIST_NEXT(ep, ifm_list), count++) 316 kptr[count] = ep->ifm_media; 317 --- 194 unchanged lines hidden --- |