From: Bart Van Assche <bvanassche@acm.org>
To: Robert Love <robert.w.love@intel.com>
Cc: cleech@redhat.com, bprakash@broadcom.com, devel@open-fcoe.org,
linux-scsi@vger.kernel.org
Subject: Re: [RFC PATCH v2 3/5] libfcoe, fcoe, bnx2fc: Add new fcoe control interface
Date: Sun, 30 Sep 2012 18:42:42 +0200 [thread overview]
Message-ID: <50687682.1000101@acm.org> (raw)
In-Reply-To: <20120927020158.20592.4844.stgit@fritz>
On 09/27/12 04:01, Robert Love wrote:
> +static ssize_t store_ctlr_enabled(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct fcoe_ctlr_device *ctlr = dev_to_ctlr(dev);
> + int val;
> + int rc;
> +
> + rc = sscanf(buf, "%d", &val);
> + if (!rc)
> + return -EINVAL;
sscanf() expects a '\0'-terminated buffer which is not guaranteed by the
caller of this function (sysfs), isn't it ?
> @@ -830,6 +983,18 @@ int __init fcoe_sysfs_setup(void)
> if (error)
> return error;
>
> + error = bus_create_file(&fcoe_bus_type, &bus_attr_ctlr_create);
> + if (error) {
> + bus_unregister(&fcoe_bus_type);
> + return error;
> + }
> +
> + error = bus_create_file(&fcoe_bus_type, &bus_attr_ctlr_destroy);
> + if (error) {
> + bus_unregister(&fcoe_bus_type);
> + return error;
> + }
> +
> return 0;
> }
It might be a good idea to use fcoe_bus_type.bus_attrs instead of
bus_create_file(). If someone ever would want to trigger these
attributes from udev immediately after an fcoe bus instance has been
created then that approach will avoid a race where udev gets notified
before these attributes got created.
> static int fcoe_add_netdev_mapping(struct net_device *netdev,
> - struct fcoe_transport *ft)
> + struct fcoe_transport *ft)
Is the above whitespace change necessary ?
Bart.
next prev parent reply other threads:[~2012-09-30 16:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 2:01 [RFC PATCH v2 0/5] Add new fcoe_sysfs based control interfaces to libfcoe, bnx2fc and fcoe Robert Love
2012-09-27 2:01 ` [RFC PATCH v2 1/5] fix_section_mismatch Robert Love
2012-09-27 2:01 ` [RFC PATCH v2 2/5] libfcoe: Add fcoe_sysfs debug logging level Robert Love
2012-09-27 2:01 ` [RFC PATCH v2 3/5] libfcoe, fcoe, bnx2fc: Add new fcoe control interface Robert Love
2012-09-30 16:42 ` Bart Van Assche [this message]
2012-09-27 2:02 ` [RFC PATCH v2 4/5] fcoe: Use the fcoe_sysfs " Robert Love
2012-09-27 2:02 ` [RFC PATCH v2 5/5] bnx2fc: " Robert Love
2012-10-01 6:49 ` Bhanu Prakash Gollapudi
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=50687682.1000101@acm.org \
--to=bvanassche@acm.org \
--cc=bprakash@broadcom.com \
--cc=cleech@redhat.com \
--cc=devel@open-fcoe.org \
--cc=linux-scsi@vger.kernel.org \
--cc=robert.w.love@intel.com \
/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.