summaryrefslogtreecommitdiff
path: root/hw/fmopl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:06:05 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:06:05 +0000
commit487414f1cbd638beb0227c7da71fe7b8a821e155 (patch)
treebb751c10d2d6953ea16cd8e192e0ee99a7d2ad7f /hw/fmopl.c
parent090f1fa3237cbbc2338d29fe7ddb7d35396cddbb (diff)
hw: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/fmopl.c')
-rw-r--r--hw/fmopl.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/hw/fmopl.c b/hw/fmopl.c
index 52cf35e3f9..b45b9c872d 100644
--- a/hw/fmopl.c
+++ b/hw/fmopl.c
@@ -619,26 +619,10 @@ static int OPLOpenTable( void )
double pom;
/* allocate dynamic tables */
- if( (TL_TABLE = malloc(TL_MAX*2*sizeof(INT32))) == NULL)
- return 0;
- if( (SIN_TABLE = malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
- {
- free(TL_TABLE);
- return 0;
- }
- if( (AMS_TABLE = malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
- {
- free(TL_TABLE);
- free(SIN_TABLE);
- return 0;
- }
- if( (VIB_TABLE = malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
- {
- free(TL_TABLE);
- free(SIN_TABLE);
- free(AMS_TABLE);
- return 0;
- }
+ TL_TABLE = qemu_malloc(TL_MAX*2*sizeof(INT32));
+ SIN_TABLE = qemu_malloc(SIN_ENT*4 *sizeof(INT32 *));
+ AMS_TABLE = qemu_malloc(AMS_ENT*2 *sizeof(INT32));
+ VIB_TABLE = qemu_malloc(VIB_ENT*2 *sizeof(INT32));
/* make total level table */
for (t = 0;t < EG_ENT-1 ;t++){
rate = ((1<<TL_BITS)-1)/pow(10,EG_STEP*t/20); /* dB -> voltage */
@@ -1221,8 +1205,7 @@ FM_OPL *OPLCreate(int type, int clock, int rate)
if(type&OPL_TYPE_ADPCM) state_size+= sizeof(YM_DELTAT);
#endif
/* allocate memory block */
- ptr = malloc(state_size);
- if(ptr==NULL) return NULL;
+ ptr = qemu_malloc(state_size);
/* clear */
memset(ptr,0,state_size);
OPL = (FM_OPL *)ptr; ptr+=sizeof(FM_OPL);