linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Cc: Bastien Nocera <hadess@hadess.net>
Subject: [PATCH 1/3] plugins/sixaxis: Fix cable pairing not working
Date: Tue,  7 Nov 2017 19:23:54 +0100	[thread overview]
Message-ID: <20171107182356.15683-1-hadess@hadess.net> (raw)

In 6c467e9, get_pairing_type() was modified to return a structure that's
allocated on the stack. While not a problem for the direct callers,
as the function is defined as "inline", function that expected to return
this structure themselves would fail, as the stack would be trampled
upon on function exit.

Make such a function (get_pairing_type_for_device()) in the sixaxis
plugin be inline as well so that its caller doesn't get garbage inside
of cable pairing information from a struct.
---
 plugins/sixaxis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 89cd8f1f5..9d0fdb5d3 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -435,7 +435,7 @@ static bool setup_device(int fd, const char *sysfs_path,
 	return true;
 }
 
-static const struct cable_pairing *
+static inline const struct cable_pairing *
 get_pairing_type_for_device(struct udev_device *udevice, uint16_t *bus,
 						char **sysfs_path)
 {
-- 
2.14.3


             reply	other threads:[~2017-11-07 18:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07 18:23 Bastien Nocera [this message]
2017-11-07 18:23 ` [PATCH 2/3] core/device: Add support for setting SDP record Bastien Nocera
2017-11-07 18:23 ` [PATCH 3/3] plugins/sixaxis: Provide DualShock 3 SDP record while adding new device Bastien Nocera
2017-11-08 11:29   ` Bastien Nocera
2017-11-08  7:49 ` [PATCH 1/3] plugins/sixaxis: Fix cable pairing not working Johan Hedberg
2017-11-08 11:06   ` Bastien Nocera

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=20171107182356.15683-1-hadess@hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-bluetooth@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 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).