All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] Handle mismatched open calls
@ 2017-04-06  9:11 Dan Carpenter
  2017-04-06 10:07 ` Sachin Prabhu
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2017-04-06  9:11 UTC (permalink / raw)
  To: sprabhu-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

Hello Sachin Prabhu,

The patch 96b75d0508f8: "Handle mismatched open calls" from Mar 3,
2017, leads to the following static checker warning:

	fs/cifs/cifssmb.c:1530 cifs_readv_receive()
	error: potential NULL dereference 'server->smallbuf'.

fs/cifs/cifssmb.c
  1519          cifs_dbg(FYI, "0: iov_base=%p iov_len=%u\n",
  1520                   rdata->iov[0].iov_base, server->total_read);
  1521  
  1522          mid->resp_buf = server->smallbuf;
  1523          server->smallbuf = NULL;
                ^^^^^^^^^^^^^^^^^^^^^^^
We set this to NULL here

  1524  
  1525          /* how much data is in the response? */
  1526          data_len = server->ops->read_data_length(buf);
  1527          if (data_offset + data_len > buflen) {
  1528                  /* data_len is corrupt -- discard frame */
  1529                  rdata->result = -EIO;
  1530                  return cifs_readv_discard(server, mid);
                                                  ^^^^^^
but we need it here.

  1531          }
  1532  
  1533          length = rdata->read_into_pages(server, rdata, data_len);
  1534          if (length < 0)
  1535                  return length;

regards,
dan carpenter

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

end of thread, other threads:[~2017-04-07 13:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06  9:11 [bug report] Handle mismatched open calls Dan Carpenter
2017-04-06 10:07 ` Sachin Prabhu
     [not found]   ` <1491473227.3042.2.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-06 18:24     ` Sachin Prabhu
     [not found]       ` <1491503047.8010.2.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-07  1:28         ` Steve French
2017-04-07  8:20         ` Dan Carpenter
2017-04-07 12:18           ` Sachin Prabhu
     [not found]             ` <1491567538.8010.6.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-07 13:05               ` Steve French
     [not found]                 ` <CAH2r5muHaA0JJ7E6fLFxO69wvLtuep8pC8_GdSsM_Lj2drYQOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-07 13:18                   ` Steve French

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.