All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erwan Velu <erwan@enovance.com>
To: fio@vger.kernel.org
Subject: Missing code in options.c ?
Date: Wed, 02 Apr 2014 11:07:42 +0200	[thread overview]
Message-ID: <533BD35E.2020703@enovance.com> (raw)

Hi Jens,

Sorry for spawning many emails but I think it's easier to follow having 
an email per problem instead of long emails with mixed stuff in it.

In options.c, we can see that :
http://git.kernel.dk/?p=fio.git;a=blob;f=options.c;h=4a54c98c15045864931ea503d3f7920bab4ae431;hb=HEAD#l212

ret = bssplit_ddir(&td->o, DDIR_READ, str) is performed while ret can be 
already setup in the previous line. I'm not mastering this part but I 
wonder what is lacks :

- a missing if (!ret) ?
- some strdup + free around ? Does using str directly is safe here ?

Wouldn't be easier to read to get some goto to the global free code at 
the end of the function instead of a multiple chained if (!ret) {} ?

Cheers,
Erwan,


             reply	other threads:[~2014-04-02  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02  9:07 Erwan Velu [this message]
2014-04-02 14:27 ` Missing code in options.c ? Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533BD35E.2020703@enovance.com \
    --to=erwan@enovance.com \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.