Skip to content

Commit

Permalink
diag: Donot queue read in error case during mhi diag open
Browse files Browse the repository at this point in the history
Donot queue any mhi diag read work when there is an error while
opening mhi diag channels.

Change-Id: Ie4a058b755dbdba7a3d12a19aebdc8f2e059e8ae
Signed-off-by: Sreelakshmi Gownipalli <[email protected]>
  • Loading branch information
Sreelakshmi Gownipalli authored and Gerrit - the friendly Code Review server committed Aug 5, 2019
1 parent a82e3f9 commit e21a447
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/char/diag/diagfwd_mhi.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ static int __mhi_open(struct diag_mhi_info *mhi_info, int open_flag)

static int mhi_open(int id)
{
int err = 0;

if (id < 0 || id >= NUM_MHI_DEV) {
pr_err("diag: In %s, invalid index %d\n", __func__, id);
return -EINVAL;
Expand All @@ -330,7 +332,9 @@ static int mhi_open(int id)
* explicitly by Diag. Open both the read and write channels (denoted by
* OPEN_CHANNELS flag)
*/
__mhi_open(&diag_mhi[id], OPEN_CHANNELS);
err = __mhi_open(&diag_mhi[id], OPEN_CHANNELS);
if (err)
return err;
diag_remote_dev_open(diag_mhi[id].dev_id);
queue_work(diag_mhi[id].mhi_wq, &(diag_mhi[id].read_work));

Expand Down

1 comment on commit e21a447

@stefanhh0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already cherry-picked, see c8f6594

Please sign in to comment.