@@ -1277,7 +1277,7 @@ static int osd_mmap(struct fb_info *info, struct vm_area_struct *vma)
1277
1277
fbdev -> fb_mem_vaddr = fb_rmem_vaddr [fb_index ];
1278
1278
if (!fbdev -> fb_mem_vaddr ) {
1279
1279
osd_log_err ("failed to ioremap frame buffer\n" );
1280
- ret = - ENOMEM ;
1280
+ return - ENOMEM ;
1281
1281
}
1282
1282
osd_log_info ("Frame buffer memory assigned at" );
1283
1283
osd_log_info (" %d, phy: 0x%p, vir:0x%p, size=%dK\n\n" ,
@@ -1318,7 +1318,8 @@ static int osd_mmap(struct fb_info *info, struct vm_area_struct *vma)
1318
1318
osd_log_info ("---------------clear fb%d memory %p\n" ,
1319
1319
fb_index , fbdev -> fb_mem_vaddr );
1320
1320
set_logo_loaded ();
1321
- memset (fbdev -> fb_mem_vaddr , 0x0 , fbdev -> fb_len );
1321
+ if (fbdev -> fb_mem_vaddr )
1322
+ memset (fbdev -> fb_mem_vaddr , 0x0 , fbdev -> fb_len );
1322
1323
if (fb_index == DEV_OSD0 && osd_get_afbc ()) {
1323
1324
for (j = 1 ; j < OSD_MAX_BUF_NUM ; j ++ ) {
1324
1325
osd_log_info (
@@ -1334,10 +1335,10 @@ static int osd_mmap(struct fb_info *info, struct vm_area_struct *vma)
1334
1335
* 1. the big buffer ion alloc
1335
1336
* 2. reserved memory
1336
1337
*/
1337
-
1338
- memset (fb_rmem_vaddr [fb_index ],
1339
- 0x0 ,
1340
- fb_rmem_size [fb_index ]);
1338
+ if ( fb_rmem_vaddr [ fb_index ])
1339
+ memset (fb_rmem_vaddr [fb_index ],
1340
+ 0x0 ,
1341
+ fb_rmem_size [fb_index ]);
1341
1342
}
1342
1343
/* setup osd if not logo layer */
1343
1344
osddev_setup (fbdev );
0 commit comments