@@ -342,19 +342,16 @@ static const char *z_erofs_transform_plain(struct z_erofs_decompress_req *rq,
342342 return NULL ;
343343}
344344
345- int z_erofs_stream_switch_bufs (struct z_erofs_stream_dctx * dctx , void * * dst ,
346- void * * src , struct page * * pgpl )
345+ const char * z_erofs_stream_switch_bufs (struct z_erofs_stream_dctx * dctx ,
346+ void * * dst , void * * src , struct page * * pgpl )
347347{
348348 struct z_erofs_decompress_req * rq = dctx -> rq ;
349- struct super_block * sb = rq -> sb ;
350349 struct page * * pgo , * tmppage ;
351350 unsigned int j ;
352351
353352 if (!dctx -> avail_out ) {
354- if (++ dctx -> no >= rq -> outpages || !rq -> outputsize ) {
355- erofs_err (sb , "insufficient space for decompressed data" );
356- return - EFSCORRUPTED ;
357- }
353+ if (++ dctx -> no >= rq -> outpages || !rq -> outputsize )
354+ return "insufficient space for decompressed data" ;
358355
359356 if (dctx -> kout )
360357 kunmap_local (dctx -> kout );
@@ -365,7 +362,7 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst,
365362 * pgo = erofs_allocpage (pgpl , rq -> gfp );
366363 if (!* pgo ) {
367364 dctx -> kout = NULL ;
368- return - ENOMEM ;
365+ return ERR_PTR ( - ENOMEM ) ;
369366 }
370367 set_page_private (* pgo , Z_EROFS_SHORTLIVED_PAGE );
371368 }
@@ -379,10 +376,8 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst,
379376 }
380377
381378 if (dctx -> inbuf_pos == dctx -> inbuf_sz && rq -> inputsize ) {
382- if (++ dctx -> ni >= rq -> inpages ) {
383- erofs_err (sb , "invalid compressed data" );
384- return - EFSCORRUPTED ;
385- }
379+ if (++ dctx -> ni >= rq -> inpages )
380+ return "invalid compressed data" ;
386381 if (dctx -> kout ) /* unlike kmap(), take care of the orders */
387382 kunmap_local (dctx -> kout );
388383 kunmap_local (dctx -> kin );
@@ -417,12 +412,12 @@ int z_erofs_stream_switch_bufs(struct z_erofs_stream_dctx *dctx, void **dst,
417412 continue ;
418413 tmppage = erofs_allocpage (pgpl , rq -> gfp );
419414 if (!tmppage )
420- return - ENOMEM ;
415+ return ERR_PTR ( - ENOMEM ) ;
421416 set_page_private (tmppage , Z_EROFS_SHORTLIVED_PAGE );
422417 copy_highpage (tmppage , rq -> in [j ]);
423418 rq -> in [j ] = tmppage ;
424419 }
425- return 0 ;
420+ return NULL ;
426421}
427422
428423const struct z_erofs_decompressor * z_erofs_decomp [] = {
0 commit comments