n_gsm: don't allow write if state is not DLCI_OPEN
authorGuillaume Lucas <guillaume.lucas@intel.com>
Thu, 12 Apr 2012 14:20:24 +0000 (16:20 +0200)
committerbuildbot <buildbot@intel.com>
Mon, 16 Apr 2012 13:46:13 +0000 (06:46 -0700)
commit25e92bedea00fe6bd2b925df777d4c64cb0602d2
tree7ee074a2fd43711ae0f1b5af0455646a3285200b
parentf2d4f44a97409ef8063d4903036f840229b01c4d
n_gsm: don't allow write if state is not DLCI_OPEN

BZ: 31586

The n_gsm code doesn't have protection to avoid to perform
a write if a DLCi is not in the DLCI_OPEN state. This means
that it's possible to have data sending to the modem when
the DLCi is in the DLCI_OPENING state. Means, when the DLCi
is performing the asynchronous open.

To avoid this, this patch fix the write operation to return
the EAGAIN error if the write is not allowed.
Signed-off-by: Guillaume Lucas <guillaume.lucas@intel.com>
Change-Id: I3a98a9960e62a82afe96b1694a0a67727d84f5bb
Reviewed-on: http://android.intel.com:8080/43298
Reviewed-by: Lucas, Guillaume <guillaume.lucas@intel.com>
Reviewed-by: Pillet, VincentX <vincentx.pillet@intel.com>
Reviewed-by: Roulliere, Pierre <pierre.roulliere@intel.com>
Reviewed-by: Robert, Denis <denis.robert@intel.com>
Reviewed-by: Predon, Frederic <frederic.predon@intel.com>
Reviewed-by: Lebsir, SamiX <samix.lebsir@intel.com>
Tested-by: Lebsir, SamiX <samix.lebsir@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
drivers/tty/n_gsm.c