mirror of https://github.com/F-Stack/f-stack.git
Merge pull request #230 from mscbg/master
F-stack:fix bug, if ff_veth_softc malloc faild, memory should not be read
This commit is contained in:
commit
5f219b2cad
|
@ -372,7 +372,7 @@ ff_veth_attach(struct ff_port_cfg *cfg)
|
||||||
|
|
||||||
sc = malloc(sizeof(struct ff_veth_softc), M_DEVBUF, M_WAITOK);
|
sc = malloc(sizeof(struct ff_veth_softc), M_DEVBUF, M_WAITOK);
|
||||||
if (NULL == sc) {
|
if (NULL == sc) {
|
||||||
printf("%s: ff_veth_softc allocation failed\n", sc->host_ifname);
|
printf("ff_veth_softc allocation failed\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
memset(sc, 0, sizeof(struct ff_veth_softc));
|
memset(sc, 0, sizeof(struct ff_veth_softc));
|
||||||
|
|
Loading…
Reference in New Issue