View | Details | Raw Unified | Return to bug 242654
Collapse All | Expand All

(-)b/sys/dev/an/if_an.c (-8 / +15 lines)
Lines 1875-1880 an_ioctl(struct ifnet *ifp, u_long command, caddr_t data) Link Here
1875
	int			len;
1875
	int			len;
1876
	int			i, max;
1876
	int			i, max;
1877
	struct an_softc		*sc;
1877
	struct an_softc		*sc;
1878
	struct an_req		*areq;
1878
	struct ifreq		*ifr;
1879
	struct ifreq		*ifr;
1879
	struct thread		*td = curthread;
1880
	struct thread		*td = curthread;
1880
	struct ieee80211req	*ireq;
1881
	struct ieee80211req	*ireq;
Lines 1934-1950 an_ioctl(struct ifnet *ifp, u_long command, caddr_t data) Link Here
1934
		error = 0;
1935
		error = 0;
1935
		break;
1936
		break;
1936
	case SIOCGAIRONET:
1937
	case SIOCGAIRONET:
1937
		error = copyin(ifr_data_get_ptr(ifr), &sc->areq,
1938
		error = priv_check(td, PRIV_DRIVER);
1938
		    sizeof(sc->areq));
1939
		if (error)
1939
		if (error != 0)
1940
			break;
1940
			break;
1941
		areq = malloc(sizeof(*areq), M_TEMP, M_WAITOK);
1942
		error = copyin(ifr_data_get_ptr(ifr), areq, sizeof(*areq));
1943
		if (error != 0) {
1944
			free(areq, M_TEMP);
1945
			break;
1946
		}
1941
		AN_LOCK(sc);
1947
		AN_LOCK(sc);
1948
		memcpy(&sc->areq, areq, sizeof(sc->areq));
1942
#ifdef ANCACHE
1949
#ifdef ANCACHE
1943
		if (sc->areq.an_type == AN_RID_ZERO_CACHE) {
1950
		if (sc->areq.an_type == AN_RID_ZERO_CACHE) {
1944
			error = priv_check(td, PRIV_DRIVER);
1945
			if (error)
1946
				break;
1947
			sc->an_sigitems = sc->an_nextitem = 0;
1951
			sc->an_sigitems = sc->an_nextitem = 0;
1952
			free(areq, M_TEMP);
1948
			break;
1953
			break;
1949
		} else if (sc->areq.an_type == AN_RID_READ_CACHE) {
1954
		} else if (sc->areq.an_type == AN_RID_READ_CACHE) {
1950
			char *pt = (char *)&sc->areq.an_val;
1955
			char *pt = (char *)&sc->areq.an_val;
Lines 1960-1971 an_ioctl(struct ifnet *ifp, u_long command, caddr_t data) Link Here
1960
#endif
1965
#endif
1961
		if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) {
1966
		if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) {
1962
			AN_UNLOCK(sc);
1967
			AN_UNLOCK(sc);
1968
			free(areq, M_TEMP);
1963
			error = EINVAL;
1969
			error = EINVAL;
1964
			break;
1970
			break;
1965
		}
1971
		}
1972
		memcpy(areq, &sc->areq, sizeof(*areq));
1966
		AN_UNLOCK(sc);
1973
		AN_UNLOCK(sc);
1967
		error = copyout(&sc->areq, ifr_data_get_ptr(ifr),
1974
		error = copyout(areq, ifr_data_get_ptr(ifr), sizeof(*areq));
1968
		    sizeof(sc->areq));
1975
		free(areq, M_TEMP);
1969
		break;
1976
		break;
1970
	case SIOCSAIRONET:
1977
	case SIOCSAIRONET:
1971
		if ((error = priv_check(td, PRIV_DRIVER)))
1978
		if ((error = priv_check(td, PRIV_DRIVER)))
(-)b/sys/dev/vnic/thunder_bgx_fdt.c (-4 / +7 lines)
Lines 35-40 __FBSDID("$FreeBSD$"); Link Here
35
#include <sys/bitset.h>
35
#include <sys/bitset.h>
36
#include <sys/bitstring.h>
36
#include <sys/bitstring.h>
37
#include <sys/bus.h>
37
#include <sys/bus.h>
38
#include <sys/ctype.h>
38
#include <sys/endian.h>
39
#include <sys/endian.h>
39
#include <sys/kernel.h>
40
#include <sys/kernel.h>
40
#include <sys/malloc.h>
41
#include <sys/malloc.h>
Lines 151-156 bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name, ssize_t size) Link Here
151
{
152
{
152
	const char *type;
153
	const char *type;
153
	ssize_t sz;
154
	ssize_t sz;
155
	char last;
154
156
155
	switch (bgx->qlm_mode) {
157
	switch (bgx->qlm_mode) {
156
	case QLM_MODE_SGMII:
158
	case QLM_MODE_SGMII:
Lines 193-202 bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name, ssize_t size) Link Here
193
195
194
	if (sz > size)
196
	if (sz > size)
195
		return (FALSE);
197
		return (FALSE);
196
	if (strncmp(phy_name, type, sz - 1) == 0 &&
198
	if (strncmp(phy_name, type, sz - 1) == 0) {
197
	    (phy_name[sz - 1] == '\0' || phy_name[sz - 1] == '@'))
199
		last = phy_name[sz - 1];
198
		return (TRUE);
200
		if (last == '\0' || last == '@' || isdigit(last))
199
201
			return (TRUE);
202
	}
200
	return (FALSE);
203
	return (FALSE);
201
}
204
}
202
205

Return to bug 242654