| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * This file contains functions used in USB interface module. |
|---|
| 3 | 4 | */ |
|---|
| .. | .. |
|---|
| 255 | 256 | goto dealloc; |
|---|
| 256 | 257 | } |
|---|
| 257 | 258 | |
|---|
| 258 | | - if (!(priv = lbs_add_card(cardp, &intf->dev))) |
|---|
| 259 | + priv = lbs_add_card(cardp, &intf->dev); |
|---|
| 260 | + if (IS_ERR(priv)) { |
|---|
| 261 | + r = PTR_ERR(priv); |
|---|
| 259 | 262 | goto err_add_card; |
|---|
| 263 | + } |
|---|
| 260 | 264 | |
|---|
| 261 | 265 | cardp->priv = priv; |
|---|
| 262 | 266 | |
|---|
| .. | .. |
|---|
| 283 | 287 | return 0; |
|---|
| 284 | 288 | |
|---|
| 285 | 289 | err_get_fw: |
|---|
| 290 | + usb_put_dev(udev); |
|---|
| 286 | 291 | lbs_remove_card(priv); |
|---|
| 287 | 292 | err_add_card: |
|---|
| 288 | 293 | if_usb_reset_device(cardp); |
|---|
| .. | .. |
|---|
| 367 | 372 | cardp->fwseqnum, cardp->totalbytes); |
|---|
| 368 | 373 | } else if (fwdata->hdr.dnldcmd == cpu_to_le32(FW_HAS_LAST_BLOCK)) { |
|---|
| 369 | 374 | lbs_deb_usb2(&cardp->udev->dev, "Host has finished FW downloading\n"); |
|---|
| 370 | | - lbs_deb_usb2(&cardp->udev->dev, "Donwloading FW JUMP BLOCK\n"); |
|---|
| 375 | + lbs_deb_usb2(&cardp->udev->dev, "Downloading FW JUMP BLOCK\n"); |
|---|
| 371 | 376 | |
|---|
| 372 | 377 | cardp->fwfinalblk = 1; |
|---|
| 373 | 378 | } |
|---|