Merge branch 'zalloc'
This commit is contained in:
commit
627feee265
|
@ -106,11 +106,12 @@ static int eisabus_probe ( struct root_device *rootdev ) {
|
||||||
for ( slot = EISA_MIN_SLOT ; slot <= EISA_MAX_SLOT ; slot++ ) {
|
for ( slot = EISA_MIN_SLOT ; slot <= EISA_MAX_SLOT ; slot++ ) {
|
||||||
/* Allocate struct eisa_device */
|
/* Allocate struct eisa_device */
|
||||||
if ( ! eisa )
|
if ( ! eisa )
|
||||||
eisa = zalloc ( sizeof ( *eisa ) );
|
eisa = malloc ( sizeof ( *eisa ) );
|
||||||
if ( ! eisa ) {
|
if ( ! eisa ) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
memset ( eisa, 0, sizeof ( *eisa ) );
|
||||||
eisa->slot = slot;
|
eisa->slot = slot;
|
||||||
eisa->ioaddr = EISA_SLOT_BASE ( eisa->slot );
|
eisa->ioaddr = EISA_SLOT_BASE ( eisa->slot );
|
||||||
|
|
||||||
|
|
|
@ -105,11 +105,12 @@ static int isabus_probe ( struct root_device *rootdev ) {
|
||||||
ioidx <= ISA_IOIDX_MAX ( driver ) ; ioidx++ ) {
|
ioidx <= ISA_IOIDX_MAX ( driver ) ; ioidx++ ) {
|
||||||
/* Allocate struct isa_device */
|
/* Allocate struct isa_device */
|
||||||
if ( ! isa )
|
if ( ! isa )
|
||||||
isa = zalloc ( sizeof ( *isa ) );
|
isa = malloc ( sizeof ( *isa ) );
|
||||||
if ( ! isa ) {
|
if ( ! isa ) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
memset ( isa, 0, sizeof ( *isa ) );
|
||||||
isa->driver = driver;
|
isa->driver = driver;
|
||||||
isa->ioaddr = ISA_IOADDR ( driver, ioidx );
|
isa->ioaddr = ISA_IOADDR ( driver, ioidx );
|
||||||
|
|
||||||
|
|
|
@ -653,11 +653,12 @@ static int isapnpbus_probe ( struct root_device *rootdev ) {
|
||||||
|
|
||||||
/* Allocate struct isapnp_device */
|
/* Allocate struct isapnp_device */
|
||||||
if ( ! isapnp )
|
if ( ! isapnp )
|
||||||
isapnp = zalloc ( sizeof ( *isapnp ) );
|
isapnp = malloc ( sizeof ( *isapnp ) );
|
||||||
if ( ! isapnp ) {
|
if ( ! isapnp ) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
memset ( isapnp, 0, sizeof ( *isapnp ) );
|
||||||
isapnp->csn = csn;
|
isapnp->csn = csn;
|
||||||
isapnp->logdev = logdev;
|
isapnp->logdev = logdev;
|
||||||
|
|
||||||
|
|
|
@ -90,11 +90,12 @@ static int mcabus_probe ( struct root_device *rootdev ) {
|
||||||
for ( slot = 0 ; slot <= MCA_MAX_SLOT_NR ; slot++ ) {
|
for ( slot = 0 ; slot <= MCA_MAX_SLOT_NR ; slot++ ) {
|
||||||
/* Allocate struct mca_device */
|
/* Allocate struct mca_device */
|
||||||
if ( ! mca )
|
if ( ! mca )
|
||||||
mca = zalloc ( sizeof ( *mca ) );
|
mca = malloc ( sizeof ( *mca ) );
|
||||||
if ( ! mca ) {
|
if ( ! mca ) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
memset ( mca, 0, sizeof ( *mca ) );
|
||||||
mca->slot = slot;
|
mca->slot = slot;
|
||||||
|
|
||||||
/* Make sure motherboard setup is off */
|
/* Make sure motherboard setup is off */
|
||||||
|
|
|
@ -245,11 +245,12 @@ static int pcibus_probe ( struct root_device *rootdev ) {
|
||||||
|
|
||||||
/* Allocate struct pci_device */
|
/* Allocate struct pci_device */
|
||||||
if ( ! pci )
|
if ( ! pci )
|
||||||
pci = zalloc ( sizeof ( *pci ) );
|
pci = malloc ( sizeof ( *pci ) );
|
||||||
if ( ! pci ) {
|
if ( ! pci ) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
memset ( pci, 0, sizeof ( *pci ) );
|
||||||
pci->bus = bus;
|
pci->bus = bus;
|
||||||
pci->devfn = devfn;
|
pci->devfn = devfn;
|
||||||
|
|
||||||
|
|
Reference in New Issue