linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [bug report] staging: erofs: introduce erofs_grab_bio
@ 2019-08-28 10:55 Dan Carpenter
  2019-08-28 11:02 ` Gao Xiang
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2019-08-28 10:55 UTC (permalink / raw)
  To: xiang; +Cc: linux-erofs

Hello Gao Xiang,

The patch 8be31270362b: "staging: erofs: introduce erofs_grab_bio"
from Aug 21, 2018, leads to the following static checker warning:

	fs/erofs/zdata.c:1272 z_erofs_vle_submit_all()
	error: 'bio' dereferencing possible ERR_PTR()

fs/erofs/zdata.c
  1259                  if (bio && force_submit) {
  1260  submit_bio_retry:
  1261                          __submit_bio(bio, REQ_OP_READ, 0);
  1262                          bio = NULL;
  1263                  }
  1264  
  1265                  if (!bio) {
  1266                          bio = erofs_grab_bio(sb, first_index + i,
  1267                                               BIO_MAX_PAGES, bi_private,
  1268                                               z_erofs_vle_read_endio, true);

This assumes erofs_grab_bio() can't fail.  It returns ERR_PTR(-ENOMEM)
on failure.

  1269                          ++nr_bios;
  1270                  }
  1271  
  1272                  err = bio_add_page(bio, page, PAGE_SIZE, 0);
  1273                  if (err < PAGE_SIZE)
  1274                          goto submit_bio_retry;
  1275  
  1276                  force_submit = false;
  1277                  last_index = first_index + i;
  1278  skippage:
  1279                  if (++i < clusterpages)
  1280                          goto repeat;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-28 12:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 10:55 [bug report] staging: erofs: introduce erofs_grab_bio Dan Carpenter
2019-08-28 11:02 ` Gao Xiang
2019-08-28 11:36   ` Dan Carpenter
2019-08-28 11:40     ` Gao Xiang
2019-08-28 11:39   ` Gao Xiang
2019-08-28 12:11     ` Dan Carpenter
2019-08-28 12:22       ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).